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

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

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

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

f = A("f")
a = B("a")
j = C("j")
c = D("c")
e = A("e")
k = C("k")

f.r = a
f.s = a
a.q = c
a.y = e
j.o = a
j.v = a
j.t = c
j.s = c
c.p = e
c.u = e
e.r = a
e.s = a
k.o = a
k.v = a
k.t = c
k.s = c
assert c.u.r.y.txt == "
class A:
    def __init__(self, txt: str):
        self.r: B = None
        self.s: B = None
        self.txt = txt

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

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

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

f = A("f")
a = B("a")
j = C("j")
c = D("c")
e = A("e")
k = C("k")

f.r = a
f.s = a
a.q = c
a.y = e
j.o = a
j.v = a
j.t = c
j.s = c
c.p = e
c.u = e
e.r = a
e.s = a
k.o = a
k.v = a
k.t = c
k.s = c
assert c.u.r.y.txt == "e"