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

class B:
    def __init__(self, txt: str):
        self.x: G = None
        self.y: E = None
        self.w: F = None
        self.o: E = None
        self.txt = txt

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

class D:
    def __init__(self, txt: str):
        self.r: C = None
        self.s: B = None
        self.w: E = None
        self.v: D = None
        self.q: C = None
        self.txt = txt

class E:
    def __init__(self, txt: str):
        self.p: C = None
        self.u: G = None
        self.txt = txt

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

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

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

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

class B:
    def __init__(self, txt: str):
        self.x: G = None
        self.y: E = None
        self.w: F = None
        self.o: E = None
        self.txt = txt

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

class D:
    def __init__(self, txt: str):
        self.r: C = None
        self.s: B = None
        self.w: E = None
        self.v: D = None
        self.q: C = None
        self.txt = txt

class E:
    def __init__(self, txt: str):
        self.p: C = None
        self.u: G = None
        self.txt = txt

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

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

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

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