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

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

class C:
    def __init__(self, txt: str):
        self.p: C = None
        self.y: D = None
        self.x: F = None
        self.r: C = None
        self.v: D = None
        self.o: E = None
        self.txt = txt

class D:
    def __init__(self, txt: str):
        self.y: C = None
        self.q: B = None
        self.s: F = None
        self.r: B = None
        self.w: F = None
        self.txt = txt

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

class F:
    def __init__(self, txt: str):
        self.z: D = None
        self.y: A = None
        self.x: B = None
        self.o: B = None
        self.txt = txt

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

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

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

class C:
    def __init__(self, txt: str):
        self.p: C = None
        self.y: D = None
        self.x: F = None
        self.r: C = None
        self.v: D = None
        self.o: E = None
        self.txt = txt

class D:
    def __init__(self, txt: str):
        self.y: C = None
        self.q: B = None
        self.s: F = None
        self.r: B = None
        self.w: F = None
        self.txt = txt

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

class F:
    def __init__(self, txt: str):
        self.z: D = None
        self.y: A = None
        self.x: B = None
        self.o: B = None
        self.txt = txt

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

e.y = b
e.z = m
g.z = i
i.p = n
i.r = n
i.y = b
i.v = b
i.x = j
i.o = k
b.y = i
b.q = f
b.r = f
b.s = j
b.w = d
k.p = g
d.z = b
d.y = m
d.x = f
d.o = g
n.p = i
n.r = i
n.y = b
n.v = b
n.x = j
n.o = k
j.z = b
j.y = m
j.x = f
j.o = f
m.y = b
m.z = e
f.z = i
assert f.z.y.w.z.y.p.y.q.z.txt == "i"