class A:
    def __init__(self, txt: str):
        self.z: G = None
        self.txt = txt

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

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

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

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

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

class G:
    def __init__(self, txt: str):
        self.p: F = None
        self.txt = txt

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

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

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

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

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

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

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

class G:
    def __init__(self, txt: str):
        self.p: F = None
        self.txt = txt

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

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