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

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

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

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

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

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

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

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

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

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

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

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

c.s = b
c.o = k
n.t = l
n.s = c
n.r = h
n.q = k
f.t = e
f.y = e
f.u = e
f.r = h
k.o = e
e.x = b
l.t = b
l.s = c
l.r = h
l.q = k
b.t = l
b.s = c
b.r = f
b.q = k
h.t = e
h.y = e
h.u = e
h.r = f
assert b.q.o.x.t.t.s.txt == "c"