class A:
    def __init__(self, txt: str):
        self.y: G = None
        self.p: C = None
        self.t: F = None
        self.r: E = None
        self.v: E = None
        self.s: G = None
        self.u: C = None
        self.txt = txt

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

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

class D:
    def __init__(self, txt: str):
        self.u: G = None
        self.s: A = None
        self.txt = txt

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

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

class G:
    def __init__(self, txt: str):
        self.y: C = None
        self.s: B = None
        self.x: A = None
        self.r: A = None
        self.txt = txt

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

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

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

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

class D:
    def __init__(self, txt: str):
        self.u: G = None
        self.s: A = None
        self.txt = txt

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

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

class G:
    def __init__(self, txt: str):
        self.y: C = None
        self.s: B = None
        self.x: A = None
        self.r: A = None
        self.txt = txt

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

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