class A:
    def __init__(self, txt: str):
        self.p: A = None
        self.t: C = None
        self.txt = txt

class B:
    def __init__(self, txt: str):
        self.p: C = None
        self.s: E = None
        self.txt = txt

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

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

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

f = A("f")
h = B("h")
c = C("c")
j = D("j")
k = E("k")
m = B("m")
l = A("l")

f.p = l
f.t = c
h.p = c
h.s = k
c.t = h
c.q = j
c.s = m
j.s = k
j.o = m
k.q = c
k.o = c
k.x = j
k.v = j
m.p = c
m.s = k
l.p = f
l.t = c
assert c.t.s.o.q.s.txt == "
class A:
    def __init__(self, txt: str):
        self.p: A = None
        self.t: C = None
        self.txt = txt

class B:
    def __init__(self, txt: str):
        self.p: C = None
        self.s: E = None
        self.txt = txt

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

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

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

f = A("f")
h = B("h")
c = C("c")
j = D("j")
k = E("k")
m = B("m")
l = A("l")

f.p = l
f.t = c
h.p = c
h.s = k
c.t = h
c.q = j
c.s = m
j.s = k
j.o = m
k.q = c
k.o = c
k.x = j
k.v = j
m.p = c
m.s = k
l.p = f
l.t = c
assert c.t.s.o.q.s.txt == "k"