class A:
    def __init__(self, txt: str):
        self.x: F = None
        self.r: B = None
        self.o: E = None
        self.z: D = None
        self.v: B = None
        self.txt = txt

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

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

class D:
    def __init__(self, txt: str):
        self.r: C = None
        self.txt = txt

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

class F:
    def __init__(self, txt: str):
        self.u: C = None
        self.t: E = None
        self.y: D = None
        self.txt = txt

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

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

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

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

class D:
    def __init__(self, txt: str):
        self.r: C = None
        self.txt = txt

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

class F:
    def __init__(self, txt: str):
        self.u: C = None
        self.t: E = None
        self.y: D = None
        self.txt = txt

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

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