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

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

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

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

m = A("m")
c = B("c")
k = C("k")
e = D("e")
d = B("d")
a = D("a")
h = A("h")
b = A("b")
j = B("j")
f = B("f")

m.t = e
m.y = a
m.w = j
c.v = b
c.u = f
c.t = a
k.r = b
k.w = c
e.s = d
e.p = d
e.x = k
e.y = b
d.v = m
d.u = f
d.t = e
a.s = f
a.p = f
a.x = k
a.y = b
h.t = a
h.y = e
h.w = c
b.t = a
b.y = a
b.w = c
j.v = m
j.u = f
j.t = a
f.v = m
f.u = j
f.t = a
assert k.r.w.v.txt == "
class A:
    def __init__(self, txt: str):
        self.t: D = None
        self.y: D = None
        self.w: B = None
        self.txt = txt

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

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

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

m = A("m")
c = B("c")
k = C("k")
e = D("e")
d = B("d")
a = D("a")
h = A("h")
b = A("b")
j = B("j")
f = B("f")

m.t = e
m.y = a
m.w = j
c.v = b
c.u = f
c.t = a
k.r = b
k.w = c
e.s = d
e.p = d
e.x = k
e.y = b
d.v = m
d.u = f
d.t = e
a.s = f
a.p = f
a.x = k
a.y = b
h.t = a
h.y = e
h.w = c
b.t = a
b.y = a
b.w = c
j.v = m
j.u = f
j.t = a
f.v = m
f.u = j
f.t = a
assert k.r.w.v.txt == "b"