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

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

class C:
    def __init__(self, txt: str):
        self.o: F = None
        self.v: C = None
        self.w: A = None
        self.r: F = None
        self.p: F = None
        self.txt = txt

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

class E:
    def __init__(self, txt: str):
        self.p: C = None
        self.y: D = None
        self.r: B = None
        self.u: B = None
        self.q: A = None
        self.x: B = None
        self.txt = txt

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

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

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

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

class C:
    def __init__(self, txt: str):
        self.o: F = None
        self.v: C = None
        self.w: A = None
        self.r: F = None
        self.p: F = None
        self.txt = txt

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

class E:
    def __init__(self, txt: str):
        self.p: C = None
        self.y: D = None
        self.r: B = None
        self.u: B = None
        self.q: A = None
        self.x: B = None
        self.txt = txt

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

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

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