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

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

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

class D:
    def __init__(self, txt: str):
        self.y: C = None
        self.x: B = None
        self.r: B = None
        self.txt = txt

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

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

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

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

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

class D:
    def __init__(self, txt: str):
        self.y: C = None
        self.x: B = None
        self.r: B = None
        self.txt = txt

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

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

b.x = f
b.s = a
b.p = c
f.r = j
f.t = c
f.q = i
d.t = c
d.r = j
d.o = a
m.y = d
m.x = f
m.r = f
a.o = i
a.v = m
c.x = f
c.s = a
c.p = b
j.t = c
j.r = h
j.o = a
h.t = c
h.r = j
h.o = a
i.r = d
i.t = c
i.q = f
k.t = c
k.r = j
k.o = a
assert c.s.o.q.txt == "f"