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

class B:
    def __init__(self, txt: str):
        self.u: A = None
        self.x: E = None
        self.z: C = None
        self.q: A = None
        self.txt = txt

class C:
    def __init__(self, txt: str):
        self.v: E = None
        self.z: A = None
        self.w: E = None
        self.s: E = None
        self.t: E = None
        self.txt = txt

class D:
    def __init__(self, txt: str):
        self.p: B = None
        self.u: A = None
        self.w: B = None
        self.txt = txt

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

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

f.t = c
f.u = c
b.u = f
b.q = f
b.x = c
b.z = d
d.v = c
d.w = c
d.s = c
d.t = c
d.z = f
j.p = b
j.u = f
j.w = n
c.x = f
n.u = f
n.q = f
n.x = c
n.z = d
assert b.z.t.x.t.x.txt == "
class A:
    def __init__(self, txt: str):
        self.t: E = None
        self.u: E = None
        self.txt = txt

class B:
    def __init__(self, txt: str):
        self.u: A = None
        self.x: E = None
        self.z: C = None
        self.q: A = None
        self.txt = txt

class C:
    def __init__(self, txt: str):
        self.v: E = None
        self.z: A = None
        self.w: E = None
        self.s: E = None
        self.t: E = None
        self.txt = txt

class D:
    def __init__(self, txt: str):
        self.p: B = None
        self.u: A = None
        self.w: B = None
        self.txt = txt

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

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

f.t = c
f.u = c
b.u = f
b.q = f
b.x = c
b.z = d
d.v = c
d.w = c
d.s = c
d.t = c
d.z = f
j.p = b
j.u = f
j.w = n
c.x = f
n.u = f
n.q = f
n.x = c
n.z = d
assert b.z.t.x.t.x.txt == "f"