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

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

class C:
    def __init__(self, txt: str):
        self.v: A = None
        self.q: E = None
        self.txt = txt

class D:
    def __init__(self, txt: str):
        self.q: B = None
        self.t: A = None
        self.u: F = None
        self.txt = txt

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

class F:
    def __init__(self, txt: str):
        self.q: C = None
        self.p: E = None
        self.o: F = None
        self.t: C = None
        self.txt = txt

c = A("c")
f = B("f")
l = C("l")
j = D("j")
n = E("n")
b = F("b")
d = F("d")

c.z = d
c.q = b
c.s = b
c.p = j
f.x = n
f.o = j
f.r = l
l.v = c
l.q = n
j.q = f
j.t = c
j.u = b
n.u = f
n.p = f
n.y = d
n.t = c
n.r = c
n.o = c
b.q = l
b.t = l
b.p = n
b.o = d
d.q = l
d.t = l
d.p = n
d.o = b
assert c.q.p.p.txt == "
class A:
    def __init__(self, txt: str):
        self.z: F = None
        self.q: F = None
        self.s: F = None
        self.p: D = None
        self.txt = txt

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

class C:
    def __init__(self, txt: str):
        self.v: A = None
        self.q: E = None
        self.txt = txt

class D:
    def __init__(self, txt: str):
        self.q: B = None
        self.t: A = None
        self.u: F = None
        self.txt = txt

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

class F:
    def __init__(self, txt: str):
        self.q: C = None
        self.p: E = None
        self.o: F = None
        self.t: C = None
        self.txt = txt

c = A("c")
f = B("f")
l = C("l")
j = D("j")
n = E("n")
b = F("b")
d = F("d")

c.z = d
c.q = b
c.s = b
c.p = j
f.x = n
f.o = j
f.r = l
l.v = c
l.q = n
j.q = f
j.t = c
j.u = b
n.u = f
n.p = f
n.y = d
n.t = c
n.r = c
n.o = c
b.q = l
b.t = l
b.p = n
b.o = d
d.q = l
d.t = l
d.p = n
d.o = b
assert c.q.p.p.txt == "f"