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

class B:
    def __init__(self, txt: str):
        self.v: E = None
        self.q: C = None
        self.y: A = None
        self.r: A = None
        self.txt = txt

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

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

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

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

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

class B:
    def __init__(self, txt: str):
        self.v: E = None
        self.q: C = None
        self.y: A = None
        self.r: A = None
        self.txt = txt

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

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

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

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

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