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

class B:
    def __init__(self, txt: str):
        self.s: E = None
        self.txt = txt

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

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

class E:
    def __init__(self, txt: str):
        self.x: A = None
        self.t: B = None
        self.w: E = None
        self.y: A = None
        self.u: C = None
        self.txt = txt

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

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

class B:
    def __init__(self, txt: str):
        self.s: E = None
        self.txt = txt

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

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

class E:
    def __init__(self, txt: str):
        self.x: A = None
        self.t: B = None
        self.w: E = None
        self.y: A = None
        self.u: C = None
        self.txt = txt

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

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