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

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

class C:
    def __init__(self, txt: str):
        self.u: A = None
        self.r: F = None
        self.q: A = None
        self.w: A = None
        self.x: E = None
        self.o: F = None
        self.txt = txt

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

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

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

j = A("j")
a = B("a")
m = C("m")
n = D("n")
b = E("b")
e = F("e")
k = D("k")

j.p = b
j.s = b
j.w = b
a.r = e
m.u = j
m.q = j
m.w = j
m.r = e
m.o = e
m.x = b
n.o = j
b.s = j
b.r = e
e.u = b
k.o = j
assert e.u.r.u.s.p.s.txt == "
class A:
    def __init__(self, txt: str):
        self.p: E = None
        self.s: E = None
        self.w: E = None
        self.txt = txt

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

class C:
    def __init__(self, txt: str):
        self.u: A = None
        self.r: F = None
        self.q: A = None
        self.w: A = None
        self.x: E = None
        self.o: F = None
        self.txt = txt

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

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

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

j = A("j")
a = B("a")
m = C("m")
n = D("n")
b = E("b")
e = F("e")
k = D("k")

j.p = b
j.s = b
j.w = b
a.r = e
m.u = j
m.q = j
m.w = j
m.r = e
m.o = e
m.x = b
n.o = j
b.s = j
b.r = e
e.u = b
k.o = j
assert e.u.r.u.s.p.s.txt == "j"