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

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

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

class D:
    def __init__(self, txt: str):
        self.x: C = None
        self.z: E = None
        self.y: E = None
        self.txt = txt

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

b = A("b")
i = B("i")
c = C("c")
e = D("e")
f = E("f")
n = C("n")
k = D("k")
m = B("m")
d = C("d")

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

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

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

class D:
    def __init__(self, txt: str):
        self.x: C = None
        self.z: E = None
        self.y: E = None
        self.txt = txt

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

b = A("b")
i = B("i")
c = C("c")
e = D("e")
f = E("f")
n = C("n")
k = D("k")
m = B("m")
d = C("d")

b.x = m
b.w = m
b.s = i
b.p = i
b.u = f
i.x = k
i.v = m
i.p = n
c.t = k
c.u = d
c.q = b
c.r = n
e.x = n
e.z = f
e.y = f
f.v = n
f.u = m
f.t = m
f.x = c
n.t = e
n.u = c
n.q = b
n.r = d
k.x = n
k.z = f
k.y = f
m.x = e
m.v = i
m.p = c
d.t = k
d.u = n
d.r = n
d.q = b
assert f.v.t.x.txt == "n"