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

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

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

class D:
    def __init__(self, txt: str):
        self.x: D = None
        self.p: A = None
        self.v: D = None
        self.z: D = None
        self.txt = txt

n = A("n")
i = B("i")
e = C("e")
c = D("c")
j = A("j")
h = A("h")
k = D("k")
b = B("b")

n.v = h
n.u = j
i.t = k
i.w = n
i.z = j
e.y = h
e.u = b
c.x = k
c.v = k
c.z = k
c.p = j
j.v = n
j.u = n
h.v = n
h.u = j
k.x = c
k.v = c
k.z = c
k.p = n
b.t = k
b.w = n
b.z = n
assert i.t.p.u.txt == "
class A:
    def __init__(self, txt: str):
        self.v: A = None
        self.u: A = None
        self.txt = txt

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

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

class D:
    def __init__(self, txt: str):
        self.x: D = None
        self.p: A = None
        self.v: D = None
        self.z: D = None
        self.txt = txt

n = A("n")
i = B("i")
e = C("e")
c = D("c")
j = A("j")
h = A("h")
k = D("k")
b = B("b")

n.v = h
n.u = j
i.t = k
i.w = n
i.z = j
e.y = h
e.u = b
c.x = k
c.v = k
c.z = k
c.p = j
j.v = n
j.u = n
h.v = n
h.u = j
k.x = c
k.v = c
k.z = c
k.p = n
b.t = k
b.w = n
b.z = n
assert i.t.p.u.txt == "j"