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

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

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

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

e = A("e")
i = B("i")
f = C("f")
h = D("h")
k = D("k")
b = B("b")

e.o = k
e.r = k
e.s = f
e.t = f
i.r = k
i.q = k
i.y = e
i.o = b
f.p = e
h.v = k
h.t = f
k.v = h
k.t = f
b.r = h
b.q = h
b.y = e
b.o = i
assert b.r.t.p.s.p.txt == "
class A:
    def __init__(self, txt: str):
        self.o: D = None
        self.r: D = None
        self.s: C = None
        self.t: C = None
        self.txt = txt

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

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

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

e = A("e")
i = B("i")
f = C("f")
h = D("h")
k = D("k")
b = B("b")

e.o = k
e.r = k
e.s = f
e.t = f
i.r = k
i.q = k
i.y = e
i.o = b
f.p = e
h.v = k
h.t = f
k.v = h
k.t = f
b.r = h
b.q = h
b.y = e
b.o = i
assert b.r.t.p.s.p.txt == "e"