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

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

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

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

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

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

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

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

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

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

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

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

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

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

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