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

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

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

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

c = A("c")
i = B("i")
b = C("b")
k = D("k")
f = C("f")
e = D("e")
m = A("m")
g = A("g")
d = A("d")

c.o = e
i.u = m
b.v = k
b.o = k
b.p = e
b.u = i
k.y = g
k.o = i
k.w = e
k.s = f
f.v = k
f.p = k
f.o = e
f.u = i
e.y = d
e.o = i
e.w = k
e.s = b
m.o = k
g.o = e
d.o = k
assert i.u.o.y.o.y.txt == "
class A:
    def __init__(self, txt: str):
        self.o: D = None
        self.txt = txt

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

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

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

c = A("c")
i = B("i")
b = C("b")
k = D("k")
f = C("f")
e = D("e")
m = A("m")
g = A("g")
d = A("d")

c.o = e
i.u = m
b.v = k
b.o = k
b.p = e
b.u = i
k.y = g
k.o = i
k.w = e
k.s = f
f.v = k
f.p = k
f.o = e
f.u = i
e.y = d
e.o = i
e.w = k
e.s = b
m.o = k
g.o = e
d.o = k
assert i.u.o.y.o.y.txt == "d"