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

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

class C:
    def __init__(self, txt: str):
        self.r: F = None
        self.w: E = None
        self.x: F = None
        self.p: F = None
        self.txt = txt

class D:
    def __init__(self, txt: str):
        self.o: F = None
        self.p: C = None
        self.x: F = None
        self.y: A = None
        self.z: A = None
        self.txt = txt

class E:
    def __init__(self, txt: str):
        self.z: F = None
        self.txt = txt

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

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

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

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

class C:
    def __init__(self, txt: str):
        self.r: F = None
        self.w: E = None
        self.x: F = None
        self.p: F = None
        self.txt = txt

class D:
    def __init__(self, txt: str):
        self.o: F = None
        self.p: C = None
        self.x: F = None
        self.y: A = None
        self.z: A = None
        self.txt = txt

class E:
    def __init__(self, txt: str):
        self.z: F = None
        self.txt = txt

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

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

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