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

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

class C:
    def __init__(self, txt: str):
        self.x: C = None
        self.r: C = None
        self.q: B = None
        self.o: A = None
        self.w: B = None
        self.txt = txt

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

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

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

n.q = m
n.t = c
n.r = e
m.q = c
m.y = a
b.x = a
b.r = a
b.q = m
b.w = m
b.o = n
f.s = c
f.p = c
f.y = c
h.s = f
c.q = e
c.r = e
c.t = n
a.x = b
a.r = b
a.q = e
a.w = e
a.o = n
e.q = n
e.y = b
k.s = c
k.p = n
k.y = n
assert e.q.r.y.txt == "
class A:
    def __init__(self, txt: str):
        self.q: B = None
        self.t: A = None
        self.r: B = None
        self.txt = txt

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

class C:
    def __init__(self, txt: str):
        self.x: C = None
        self.r: C = None
        self.q: B = None
        self.o: A = None
        self.w: B = None
        self.txt = txt

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

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

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

n.q = m
n.t = c
n.r = e
m.q = c
m.y = a
b.x = a
b.r = a
b.q = m
b.w = m
b.o = n
f.s = c
f.p = c
f.y = c
h.s = f
c.q = e
c.r = e
c.t = n
a.x = b
a.r = b
a.q = e
a.w = e
a.o = n
e.q = n
e.y = b
k.s = c
k.p = n
k.y = n
assert e.q.r.y.txt == "b"