class A:
    def __init__(self, txt: str):
        self.p: F = None
        self.r: C = None
        self.w: G = None
        self.y: B = None
        self.t: B = None
        self.o: B = None
        self.txt = txt

class B:
    def __init__(self, txt: str):
        self.t: F = None
        self.w: E = None
        self.r: E = None
        self.p: C = None
        self.q: H = None
        self.y: F = None
        self.txt = txt

class C:
    def __init__(self, txt: str):
        self.v: D = None
        self.txt = txt

class D:
    def __init__(self, txt: str):
        self.u: C = None
        self.z: B = None
        self.v: B = None
        self.x: E = None
        self.p: C = None
        self.s: C = None
        self.o: H = None
        self.txt = txt

class E:
    def __init__(self, txt: str):
        self.x: D = None
        self.s: A = None
        self.txt = txt

class F:
    def __init__(self, txt: str):
        self.z: B = None
        self.x: A = None
        self.t: G = None
        self.y: E = None
        self.txt = txt

class G:
    def __init__(self, txt: str):
        self.s: H = None
        self.txt = txt

class H:
    def __init__(self, txt: str):
        self.q: C = None
        self.x: E = None
        self.s: C = None
        self.u: F = None
        self.z: F = None
        self.y: B = None
        self.w: G = None
        self.txt = txt

d = A("d")
g = B("g")
c = C("c")
n = D("n")
b = E("b")
f = F("f")
l = G("l")
h = H("h")

d.p = f
d.r = c
d.w = l
d.y = g
d.t = g
d.o = g
g.t = f
g.y = f
g.w = b
g.r = b
g.p = c
g.q = h
c.v = n
n.u = c
n.p = c
n.s = c
n.z = g
n.v = g
n.x = b
n.o = h
b.x = n
b.s = d
f.z = g
f.x = d
f.t = l
f.y = b
l.s = h
h.q = c
h.s = c
h.x = b
h.u = f
h.z = f
h.y = g
h.w = l
assert c.v.o.y.y.txt == "
class A:
    def __init__(self, txt: str):
        self.p: F = None
        self.r: C = None
        self.w: G = None
        self.y: B = None
        self.t: B = None
        self.o: B = None
        self.txt = txt

class B:
    def __init__(self, txt: str):
        self.t: F = None
        self.w: E = None
        self.r: E = None
        self.p: C = None
        self.q: H = None
        self.y: F = None
        self.txt = txt

class C:
    def __init__(self, txt: str):
        self.v: D = None
        self.txt = txt

class D:
    def __init__(self, txt: str):
        self.u: C = None
        self.z: B = None
        self.v: B = None
        self.x: E = None
        self.p: C = None
        self.s: C = None
        self.o: H = None
        self.txt = txt

class E:
    def __init__(self, txt: str):
        self.x: D = None
        self.s: A = None
        self.txt = txt

class F:
    def __init__(self, txt: str):
        self.z: B = None
        self.x: A = None
        self.t: G = None
        self.y: E = None
        self.txt = txt

class G:
    def __init__(self, txt: str):
        self.s: H = None
        self.txt = txt

class H:
    def __init__(self, txt: str):
        self.q: C = None
        self.x: E = None
        self.s: C = None
        self.u: F = None
        self.z: F = None
        self.y: B = None
        self.w: G = None
        self.txt = txt

d = A("d")
g = B("g")
c = C("c")
n = D("n")
b = E("b")
f = F("f")
l = G("l")
h = H("h")

d.p = f
d.r = c
d.w = l
d.y = g
d.t = g
d.o = g
g.t = f
g.y = f
g.w = b
g.r = b
g.p = c
g.q = h
c.v = n
n.u = c
n.p = c
n.s = c
n.z = g
n.v = g
n.x = b
n.o = h
b.x = n
b.s = d
f.z = g
f.x = d
f.t = l
f.y = b
l.s = h
h.q = c
h.s = c
h.x = b
h.u = f
h.z = f
h.y = g
h.w = l
assert c.v.o.y.y.txt == "f"