class A:
    def __init__(self, txt: str):
        self.v: E = None
        self.o: G = None
        self.r: D = None
        self.txt = txt

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

class C:
    def __init__(self, txt: str):
        self.x: H = None
        self.s: F = None
        self.w: E = None
        self.t: H = None
        self.z: D = None
        self.q: F = None
        self.txt = txt

class D:
    def __init__(self, txt: str):
        self.v: E = None
        self.txt = txt

class E:
    def __init__(self, txt: str):
        self.p: C = None
        self.y: B = None
        self.s: G = None
        self.q: D = None
        self.txt = txt

class F:
    def __init__(self, txt: str):
        self.o: E = None
        self.t: A = None
        self.w: H = None
        self.v: H = None
        self.txt = txt

class G:
    def __init__(self, txt: str):
        self.t: F = None
        self.txt = txt

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

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

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

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

class C:
    def __init__(self, txt: str):
        self.x: H = None
        self.s: F = None
        self.w: E = None
        self.t: H = None
        self.z: D = None
        self.q: F = None
        self.txt = txt

class D:
    def __init__(self, txt: str):
        self.v: E = None
        self.txt = txt

class E:
    def __init__(self, txt: str):
        self.p: C = None
        self.y: B = None
        self.s: G = None
        self.q: D = None
        self.txt = txt

class F:
    def __init__(self, txt: str):
        self.o: E = None
        self.t: A = None
        self.w: H = None
        self.v: H = None
        self.txt = txt

class G:
    def __init__(self, txt: str):
        self.t: F = None
        self.txt = txt

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

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

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