class A:
    def __init__(self, txt: str):
        self.q: B = None
        self.y: E = None
        self.z: D = None
        self.s: D = None
        self.txt = txt

class B:
    def __init__(self, txt: str):
        self.z: E = None
        self.r: A = None
        self.y: E = None
        self.s: D = None
        self.txt = txt

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

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

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

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

b.q = k
b.y = c
b.z = g
b.s = n
k.z = e
k.y = e
k.r = b
k.s = n
j.s = n
g.v = n
g.o = n
g.r = j
g.x = j
g.p = b
e.p = b
e.x = c
e.s = c
e.y = g
e.w = j
c.p = b
c.x = e
c.s = e
c.y = n
c.w = j
n.v = g
n.o = g
n.r = j
n.x = j
n.p = b
assert j.s.p.s.p.txt == "
class A:
    def __init__(self, txt: str):
        self.q: B = None
        self.y: E = None
        self.z: D = None
        self.s: D = None
        self.txt = txt

class B:
    def __init__(self, txt: str):
        self.z: E = None
        self.r: A = None
        self.y: E = None
        self.s: D = None
        self.txt = txt

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

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

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

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

b.q = k
b.y = c
b.z = g
b.s = n
k.z = e
k.y = e
k.r = b
k.s = n
j.s = n
g.v = n
g.o = n
g.r = j
g.x = j
g.p = b
e.p = b
e.x = c
e.s = c
e.y = g
e.w = j
c.p = b
c.x = e
c.s = e
c.y = n
c.w = j
n.v = g
n.o = g
n.r = j
n.x = j
n.p = b
assert j.s.p.s.p.txt == "b"