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

class B:
    def __init__(self, txt: str):
        self.z: E = None
        self.w: E = None
        self.q: C = None
        self.y: F = None
        self.v: C = None
        self.txt = txt

class C:
    def __init__(self, txt: str):
        self.v: H = None
        self.t: I = None
        self.txt = txt

class D:
    def __init__(self, txt: str):
        self.q: C = None
        self.s: A = None
        self.y: C = None
        self.t: B = None
        self.v: B = None
        self.r: G = None
        self.p: B = None
        self.w: C = None
        self.txt = txt

class E:
    def __init__(self, txt: str):
        self.p: G = None
        self.r: H = None
        self.y: G = None
        self.s: F = None
        self.o: C = None
        self.txt = txt

class F:
    def __init__(self, txt: str):
        self.q: A = None
        self.z: B = None
        self.txt = txt

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

class H:
    def __init__(self, txt: str):
        self.o: F = None
        self.x: C = None
        self.w: F = None
        self.txt = txt

class I:
    def __init__(self, txt: str):
        self.x: F = None
        self.q: G = None
        self.v: G = None
        self.p: F = None
        self.s: G = None
        self.t: C = None
        self.r: H = None
        self.u: F = None
        self.txt = txt

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

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

class B:
    def __init__(self, txt: str):
        self.z: E = None
        self.w: E = None
        self.q: C = None
        self.y: F = None
        self.v: C = None
        self.txt = txt

class C:
    def __init__(self, txt: str):
        self.v: H = None
        self.t: I = None
        self.txt = txt

class D:
    def __init__(self, txt: str):
        self.q: C = None
        self.s: A = None
        self.y: C = None
        self.t: B = None
        self.v: B = None
        self.r: G = None
        self.p: B = None
        self.w: C = None
        self.txt = txt

class E:
    def __init__(self, txt: str):
        self.p: G = None
        self.r: H = None
        self.y: G = None
        self.s: F = None
        self.o: C = None
        self.txt = txt

class F:
    def __init__(self, txt: str):
        self.q: A = None
        self.z: B = None
        self.txt = txt

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

class H:
    def __init__(self, txt: str):
        self.o: F = None
        self.x: C = None
        self.w: F = None
        self.txt = txt

class I:
    def __init__(self, txt: str):
        self.x: F = None
        self.q: G = None
        self.v: G = None
        self.p: F = None
        self.s: G = None
        self.t: C = None
        self.r: H = None
        self.u: F = None
        self.txt = txt

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

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