class A:
    def __init__(self, txt: str):
        self.r: D = None
        self.txt = txt

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

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

class D:
    def __init__(self, txt: str):
        self.x: I = None
        self.v: A = None
        self.s: B = None
        self.z: E = None
        self.p: A = None
        self.o: E = None
        self.txt = txt

class E:
    def __init__(self, txt: str):
        self.y: D = None
        self.q: C = None
        self.u: H = None
        self.txt = txt

class F:
    def __init__(self, txt: str):
        self.y: D = None
        self.z: G = None
        self.r: E = None
        self.p: F = None
        self.u: H = None
        self.t: C = None
        self.txt = txt

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

class H:
    def __init__(self, txt: str):
        self.y: D = None
        self.txt = txt

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

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

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

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

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

class D:
    def __init__(self, txt: str):
        self.x: I = None
        self.v: A = None
        self.s: B = None
        self.z: E = None
        self.p: A = None
        self.o: E = None
        self.txt = txt

class E:
    def __init__(self, txt: str):
        self.y: D = None
        self.q: C = None
        self.u: H = None
        self.txt = txt

class F:
    def __init__(self, txt: str):
        self.y: D = None
        self.z: G = None
        self.r: E = None
        self.p: F = None
        self.u: H = None
        self.t: C = None
        self.txt = txt

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

class H:
    def __init__(self, txt: str):
        self.y: D = None
        self.txt = txt

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

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

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