class A:
    def __init__(self, txt: str):
        self.y: D = None
        self.x: B = None
        self.p: D = None
        self.t: D = None
        self.u: D = None
        self.z: H = None
        self.txt = txt

class B:
    def __init__(self, txt: str):
        self.p: G = None
        self.v: H = None
        self.x: E = None
        self.txt = txt

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

class D:
    def __init__(self, txt: str):
        self.u: H = None
        self.z: C = None
        self.txt = txt

class E:
    def __init__(self, txt: str):
        self.s: G = None
        self.q: A = None
        self.t: D = None
        self.v: D = None
        self.r: D = None
        self.txt = txt

class F:
    def __init__(self, txt: str):
        self.x: B = None
        self.y: G = None
        self.s: A = None
        self.u: H = None
        self.z: A = None
        self.o: C = None
        self.t: B = None
        self.txt = txt

class G:
    def __init__(self, txt: str):
        self.y: D = None
        self.u: A = None
        self.txt = txt

class H:
    def __init__(self, txt: str):
        self.t: E = None
        self.o: E = None
        self.txt = txt

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

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

class B:
    def __init__(self, txt: str):
        self.p: G = None
        self.v: H = None
        self.x: E = None
        self.txt = txt

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

class D:
    def __init__(self, txt: str):
        self.u: H = None
        self.z: C = None
        self.txt = txt

class E:
    def __init__(self, txt: str):
        self.s: G = None
        self.q: A = None
        self.t: D = None
        self.v: D = None
        self.r: D = None
        self.txt = txt

class F:
    def __init__(self, txt: str):
        self.x: B = None
        self.y: G = None
        self.s: A = None
        self.u: H = None
        self.z: A = None
        self.o: C = None
        self.t: B = None
        self.txt = txt

class G:
    def __init__(self, txt: str):
        self.y: D = None
        self.u: A = None
        self.txt = txt

class H:
    def __init__(self, txt: str):
        self.t: E = None
        self.o: E = None
        self.txt = txt

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

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