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

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

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

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

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

class F:
    def __init__(self, txt: str):
        self.w: B = None
        self.q: B = None
        self.o: B = None
        self.p: D = None
        self.txt = txt

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

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

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

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

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

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

class F:
    def __init__(self, txt: str):
        self.w: B = None
        self.q: B = None
        self.o: B = None
        self.p: D = None
        self.txt = txt

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

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