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

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

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

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

e = A("e")
n = B("n")
m = C("m")
k = D("k")
h = A("h")
f = C("f")

e.t = k
e.u = h
e.s = h
n.v = h
m.u = f
m.y = f
m.r = h
m.w = n
k.y = n
h.t = k
h.u = e
h.s = e
f.u = m
f.y = m
f.r = e
f.w = n
assert e.t.y.v.txt == "
class A:
    def __init__(self, txt: str):
        self.t: D = None
        self.u: A = None
        self.s: A = None
        self.txt = txt

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

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

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

e = A("e")
n = B("n")
m = C("m")
k = D("k")
h = A("h")
f = C("f")

e.t = k
e.u = h
e.s = h
n.v = h
m.u = f
m.y = f
m.r = h
m.w = n
k.y = n
h.t = k
h.u = e
h.s = e
f.u = m
f.y = m
f.r = e
f.w = n
assert e.t.y.v.txt == "h"