class A:
    def __init__(self, txt: str):
        self.p: E = None
        self.txt = txt

class B:
    def __init__(self, txt: str):
        self.r: F = None
        self.v: D = None
        self.o: G = None
        self.u: C = None
        self.y: F = None
        self.q: A = None
        self.s: E = None
        self.txt = txt

class C:
    def __init__(self, txt: str):
        self.z: B = None
        self.u: D = None
        self.r: D = None
        self.w: E = None
        self.t: D = None
        self.txt = txt

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

class E:
    def __init__(self, txt: str):
        self.s: G = None
        self.p: F = None
        self.txt = txt

class F:
    def __init__(self, txt: str):
        self.x: B = None
        self.u: G = None
        self.w: C = None
        self.txt = txt

class G:
    def __init__(self, txt: str):
        self.v: E = None
        self.x: C = None
        self.o: D = None
        self.w: C = None
        self.txt = txt

n = A("n")
j = B("j")
e = C("e")
i = D("i")
l = E("l")
a = F("a")
h = G("h")

n.p = l
j.r = a
j.y = a
j.v = i
j.o = h
j.u = e
j.q = n
j.s = l
e.z = j
e.u = i
e.r = i
e.t = i
e.w = l
i.p = j
l.s = h
l.p = a
a.x = j
a.u = h
a.w = e
h.v = l
h.x = e
h.w = e
h.o = i
assert h.v.p.w.u.txt == "
class A:
    def __init__(self, txt: str):
        self.p: E = None
        self.txt = txt

class B:
    def __init__(self, txt: str):
        self.r: F = None
        self.v: D = None
        self.o: G = None
        self.u: C = None
        self.y: F = None
        self.q: A = None
        self.s: E = None
        self.txt = txt

class C:
    def __init__(self, txt: str):
        self.z: B = None
        self.u: D = None
        self.r: D = None
        self.w: E = None
        self.t: D = None
        self.txt = txt

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

class E:
    def __init__(self, txt: str):
        self.s: G = None
        self.p: F = None
        self.txt = txt

class F:
    def __init__(self, txt: str):
        self.x: B = None
        self.u: G = None
        self.w: C = None
        self.txt = txt

class G:
    def __init__(self, txt: str):
        self.v: E = None
        self.x: C = None
        self.o: D = None
        self.w: C = None
        self.txt = txt

n = A("n")
j = B("j")
e = C("e")
i = D("i")
l = E("l")
a = F("a")
h = G("h")

n.p = l
j.r = a
j.y = a
j.v = i
j.o = h
j.u = e
j.q = n
j.s = l
e.z = j
e.u = i
e.r = i
e.t = i
e.w = l
i.p = j
l.s = h
l.p = a
a.x = j
a.u = h
a.w = e
h.v = l
h.x = e
h.w = e
h.o = i
assert h.v.p.w.u.txt == "i"