class A:
    def __init__(self, txt: str):
        self.z: E = None
        self.p: G = None
        self.txt = txt

class B:
    def __init__(self, txt: str):
        self.x: D = None
        self.txt = txt

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

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

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

class F:
    def __init__(self, txt: str):
        self.x: C = None
        self.txt = txt

class G:
    def __init__(self, txt: str):
        self.u: E = None
        self.x: E = None
        self.o: D = None
        self.v: B = None
        self.t: C = None
        self.q: C = None
        self.p: F = None
        self.txt = txt

class H:
    def __init__(self, txt: str):
        self.v: A = None
        self.w: G = None
        self.y: G = None
        self.s: E = None
        self.p: D = None
        self.txt = txt

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

f.z = h
f.p = k
i.x = c
d.u = c
d.s = c
d.q = k
d.z = i
d.v = h
d.w = h
d.x = b
c.t = f
c.x = f
h.t = k
h.z = b
h.x = b
b.x = d
k.u = h
k.x = h
k.o = c
k.v = i
k.t = d
k.q = d
k.p = b
l.v = f
l.w = k
l.y = k
l.s = h
l.p = c
assert l.w.p.x.q.o.t.txt == "
class A:
    def __init__(self, txt: str):
        self.z: E = None
        self.p: G = None
        self.txt = txt

class B:
    def __init__(self, txt: str):
        self.x: D = None
        self.txt = txt

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

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

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

class F:
    def __init__(self, txt: str):
        self.x: C = None
        self.txt = txt

class G:
    def __init__(self, txt: str):
        self.u: E = None
        self.x: E = None
        self.o: D = None
        self.v: B = None
        self.t: C = None
        self.q: C = None
        self.p: F = None
        self.txt = txt

class H:
    def __init__(self, txt: str):
        self.v: A = None
        self.w: G = None
        self.y: G = None
        self.s: E = None
        self.p: D = None
        self.txt = txt

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

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