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

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

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

class D:
    def __init__(self, txt: str):
        self.w: A = None
        self.v: C = None
        self.z: C = None
        self.u: D = None
        self.txt = txt

c = A("c")
h = B("h")
b = C("b")
f = D("f")
m = D("m")
j = C("j")
g = D("g")
l = C("l")
k = D("k")

c.v = h
c.y = b
c.o = g
h.u = j
h.r = j
b.v = c
b.p = h
f.w = c
f.v = j
f.z = l
f.u = m
m.w = c
m.v = j
m.z = j
m.u = f
j.v = c
j.p = h
g.w = c
g.v = j
g.z = j
g.u = k
l.v = c
l.p = h
k.w = c
k.v = j
k.z = l
k.u = f
assert c.o.u.u.v.p.r.txt == "
class A:
    def __init__(self, txt: str):
        self.v: B = None
        self.y: C = None
        self.o: D = None
        self.txt = txt

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

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

class D:
    def __init__(self, txt: str):
        self.w: A = None
        self.v: C = None
        self.z: C = None
        self.u: D = None
        self.txt = txt

c = A("c")
h = B("h")
b = C("b")
f = D("f")
m = D("m")
j = C("j")
g = D("g")
l = C("l")
k = D("k")

c.v = h
c.y = b
c.o = g
h.u = j
h.r = j
b.v = c
b.p = h
f.w = c
f.v = j
f.z = l
f.u = m
m.w = c
m.v = j
m.z = j
m.u = f
j.v = c
j.p = h
g.w = c
g.v = j
g.z = j
g.u = k
l.v = c
l.p = h
k.w = c
k.v = j
k.z = l
k.u = f
assert c.o.u.u.v.p.r.txt == "j"