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

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

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

class D:
    def __init__(self, txt: str):
        self.z: B = None
        self.t: A = None
        self.o: F = None
        self.v: A = None
        self.w: D = None
        self.txt = txt

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

class F:
    def __init__(self, txt: str):
        self.q: C = None
        self.r: D = None
        self.o: D = None
        self.txt = txt

m = A("m")
a = B("a")
j = C("j")
c = D("c")
d = E("d")
h = F("h")
b = E("b")
n = F("n")
k = D("k")
f = B("f")

m.p = h
a.o = f
a.r = m
a.v = b
a.p = k
a.y = j
a.w = j
j.r = n
j.o = f
c.z = f
c.t = m
c.v = m
c.o = n
c.w = k
d.u = j
h.q = j
h.r = k
h.o = c
b.u = j
n.q = j
n.r = c
n.o = c
k.z = f
k.t = m
k.v = m
k.o = h
k.w = c
f.o = a
f.r = m
f.v = b
f.p = c
f.y = j
f.w = j
assert c.o.o.z.txt == "
class A:
    def __init__(self, txt: str):
        self.p: F = None
        self.txt = txt

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

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

class D:
    def __init__(self, txt: str):
        self.z: B = None
        self.t: A = None
        self.o: F = None
        self.v: A = None
        self.w: D = None
        self.txt = txt

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

class F:
    def __init__(self, txt: str):
        self.q: C = None
        self.r: D = None
        self.o: D = None
        self.txt = txt

m = A("m")
a = B("a")
j = C("j")
c = D("c")
d = E("d")
h = F("h")
b = E("b")
n = F("n")
k = D("k")
f = B("f")

m.p = h
a.o = f
a.r = m
a.v = b
a.p = k
a.y = j
a.w = j
j.r = n
j.o = f
c.z = f
c.t = m
c.v = m
c.o = n
c.w = k
d.u = j
h.q = j
h.r = k
h.o = c
b.u = j
n.q = j
n.r = c
n.o = c
k.z = f
k.t = m
k.v = m
k.o = h
k.w = c
f.o = a
f.r = m
f.v = b
f.p = c
f.y = j
f.w = j
assert c.o.o.z.txt == "f"