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

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

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

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

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

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

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

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

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

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

k.v = j
k.y = b
k.o = l
k.s = l
h.t = b
h.r = b
h.x = b
n.s = m
n.v = c
n.z = h
c.u = m
c.w = l
c.r = g
d.u = m
d.w = k
d.r = l
l.v = c
l.y = h
l.o = g
l.s = g
g.v = j
g.y = h
g.o = k
g.s = l
j.u = n
j.w = l
j.r = k
b.t = h
b.r = h
b.x = h
m.s = n
m.v = d
m.z = b
assert k.o.y.x.txt == "b"