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

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

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

class D:
    def __init__(self, txt: str):
        self.z: I = None
        self.x: I = None
        self.u: B = None
        self.y: I = None
        self.q: A = None
        self.w: A = None
        self.v: B = None
        self.txt = txt

class E:
    def __init__(self, txt: str):
        self.z: G = None
        self.t: I = None
        self.o: A = None
        self.v: G = None
        self.u: G = None
        self.p: A = None
        self.w: B = None
        self.txt = txt

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

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

class H:
    def __init__(self, txt: str):
        self.x: I = None
        self.w: A = None
        self.s: B = None
        self.y: E = None
        self.u: B = None
        self.o: F = None
        self.v: F = None
        self.q: G = None
        self.txt = txt

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

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

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

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

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

class D:
    def __init__(self, txt: str):
        self.z: I = None
        self.x: I = None
        self.u: B = None
        self.y: I = None
        self.q: A = None
        self.w: A = None
        self.v: B = None
        self.txt = txt

class E:
    def __init__(self, txt: str):
        self.z: G = None
        self.t: I = None
        self.o: A = None
        self.v: G = None
        self.u: G = None
        self.p: A = None
        self.w: B = None
        self.txt = txt

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

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

class H:
    def __init__(self, txt: str):
        self.x: I = None
        self.w: A = None
        self.s: B = None
        self.y: E = None
        self.u: B = None
        self.o: F = None
        self.v: F = None
        self.q: G = None
        self.txt = txt

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

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

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