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

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

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

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

m = A("m")
c = B("c")
h = C("h")
i = D("i")
d = C("d")
e = D("e")
j = B("j")
b = C("b")

m.s = c
m.v = c
m.u = i
c.r = j
h.v = c
h.y = c
h.o = j
h.p = e
i.r = c
d.v = j
d.o = c
d.y = c
d.p = i
e.r = c
j.r = c
b.v = c
b.o = j
b.y = j
b.p = e
assert b.v.r.r.r.r.txt == "
class A:
    def __init__(self, txt: str):
        self.s: B = None
        self.u: D = None
        self.v: B = None
        self.txt = txt

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

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

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

m = A("m")
c = B("c")
h = C("h")
i = D("i")
d = C("d")
e = D("e")
j = B("j")
b = C("b")

m.s = c
m.v = c
m.u = i
c.r = j
h.v = c
h.y = c
h.o = j
h.p = e
i.r = c
d.v = j
d.o = c
d.y = c
d.p = i
e.r = c
j.r = c
b.v = c
b.o = j
b.y = j
b.p = e
assert b.v.r.r.r.r.txt == "c"