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

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

class C:
    def __init__(self, txt: str):
        self.s: A = None
        self.p: D = None
        self.r: E = None
        self.txt = txt

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

class E:
    def __init__(self, txt: str):
        self.s: A = None
        self.r: D = None
        self.txt = txt

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

e = A("e")
j = B("j")
b = C("b")
f = D("f")
c = E("c")
a = F("a")

e.p = f
e.o = b
j.t = e
j.x = e
b.s = e
b.p = f
b.r = c
f.p = a
f.u = b
f.y = j
f.q = j
f.s = j
f.r = e
c.s = e
c.r = f
a.x = b
a.t = b
a.u = j
a.o = f
assert a.o.u.s.p.txt == "
class A:
    def __init__(self, txt: str):
        self.p: D = None
        self.o: C = None
        self.txt = txt

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

class C:
    def __init__(self, txt: str):
        self.s: A = None
        self.p: D = None
        self.r: E = None
        self.txt = txt

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

class E:
    def __init__(self, txt: str):
        self.s: A = None
        self.r: D = None
        self.txt = txt

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

e = A("e")
j = B("j")
b = C("b")
f = D("f")
c = E("c")
a = F("a")

e.p = f
e.o = b
j.t = e
j.x = e
b.s = e
b.p = f
b.r = c
f.p = a
f.u = b
f.y = j
f.q = j
f.s = j
f.r = e
c.s = e
c.r = f
a.x = b
a.t = b
a.u = j
a.o = f
assert a.o.u.s.p.txt == "f"