class A:
    def __init__(self, txt: str):
        self.y: C = None
        self.txt = txt

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

class C:
    def __init__(self, txt: str):
        self.z: D = None
        self.x: B = None
        self.q: C = None
        self.w: C = None
        self.t: A = None
        self.s: D = None
        self.txt = txt

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

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

class F:
    def __init__(self, txt: str):
        self.y: A = None
        self.u: C = None
        self.p: F = None
        self.q: B = None
        self.txt = txt

h = A("h")
e = B("e")
j = C("j")
d = D("d")
b = E("b")
f = F("f")
g = C("g")
k = F("k")
i = B("i")

h.y = g
e.y = d
j.z = d
j.s = d
j.x = i
j.q = g
j.w = g
j.t = h
d.z = i
d.w = j
b.o = h
b.y = e
b.w = k
b.r = k
b.p = f
b.z = g
f.y = h
f.u = j
f.p = k
f.q = e
g.z = d
g.s = d
g.x = i
g.q = j
g.w = j
g.t = h
k.y = h
k.u = j
k.p = f
k.q = e
i.y = d
assert h.y.w.x.y.z.y.w.x.txt == "
class A:
    def __init__(self, txt: str):
        self.y: C = None
        self.txt = txt

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

class C:
    def __init__(self, txt: str):
        self.z: D = None
        self.x: B = None
        self.q: C = None
        self.w: C = None
        self.t: A = None
        self.s: D = None
        self.txt = txt

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

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

class F:
    def __init__(self, txt: str):
        self.y: A = None
        self.u: C = None
        self.p: F = None
        self.q: B = None
        self.txt = txt

h = A("h")
e = B("e")
j = C("j")
d = D("d")
b = E("b")
f = F("f")
g = C("g")
k = F("k")
i = B("i")

h.y = g
e.y = d
j.z = d
j.s = d
j.x = i
j.q = g
j.w = g
j.t = h
d.z = i
d.w = j
b.o = h
b.y = e
b.w = k
b.r = k
b.p = f
b.z = g
f.y = h
f.u = j
f.p = k
f.q = e
g.z = d
g.s = d
g.x = i
g.q = j
g.w = j
g.t = h
k.y = h
k.u = j
k.p = f
k.q = e
i.y = d
assert h.y.w.x.y.z.y.w.x.txt == "i"