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

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

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

class D:
    def __init__(self, txt: str):
        self.u: E = None
        self.p: H = None
        self.v: H = None
        self.q: C = None
        self.r: G = None
        self.s: H = None
        self.txt = txt

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

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

class G:
    def __init__(self, txt: str):
        self.s: E = None
        self.w: D = None
        self.p: D = None
        self.t: C = None
        self.txt = txt

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

a = A("a")
g = B("g")
b = C("b")
j = D("j")
h = E("h")
e = F("e")
k = G("k")
m = H("m")
d = A("d")
l = B("l")

a.x = k
a.v = h
a.w = l
g.v = b
b.p = k
b.u = a
b.x = j
b.w = j
b.r = m
b.v = m
b.o = e
j.u = h
j.p = m
j.v = m
j.s = m
j.q = b
j.r = k
h.t = a
h.r = d
e.z = b
k.s = h
k.w = j
k.p = j
k.t = b
m.w = g
d.x = k
d.v = h
d.w = g
l.v = b
assert b.o.z.p.t.o.z.p.txt == "
class A:
    def __init__(self, txt: str):
        self.x: G = None
        self.v: E = None
        self.w: B = None
        self.txt = txt

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

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

class D:
    def __init__(self, txt: str):
        self.u: E = None
        self.p: H = None
        self.v: H = None
        self.q: C = None
        self.r: G = None
        self.s: H = None
        self.txt = txt

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

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

class G:
    def __init__(self, txt: str):
        self.s: E = None
        self.w: D = None
        self.p: D = None
        self.t: C = None
        self.txt = txt

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

a = A("a")
g = B("g")
b = C("b")
j = D("j")
h = E("h")
e = F("e")
k = G("k")
m = H("m")
d = A("d")
l = B("l")

a.x = k
a.v = h
a.w = l
g.v = b
b.p = k
b.u = a
b.x = j
b.w = j
b.r = m
b.v = m
b.o = e
j.u = h
j.p = m
j.v = m
j.s = m
j.q = b
j.r = k
h.t = a
h.r = d
e.z = b
k.s = h
k.w = j
k.p = j
k.t = b
m.w = g
d.x = k
d.v = h
d.w = g
l.v = b
assert b.o.z.p.t.o.z.p.txt == "k"