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

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

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

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

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

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

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

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

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

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

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

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

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