class A:
    def __init__(self, txt: str):
        self.r: B = None
        self.q: F = None
        self.p: B = None
        self.w: C = None
        self.t: F = None
        self.v: F = None
        self.o: F = None
        self.txt = txt

class B:
    def __init__(self, txt: str):
        self.r: F = None
        self.x: D = None
        self.z: D = None
        self.txt = txt

class C:
    def __init__(self, txt: str):
        self.u: G = None
        self.v: F = None
        self.r: A = None
        self.w: I = None
        self.y: E = None
        self.t: G = None
        self.txt = txt

class D:
    def __init__(self, txt: str):
        self.r: E = None
        self.p: I = None
        self.v: I = None
        self.o: A = None
        self.x: G = None
        self.y: C = None
        self.w: E = None
        self.txt = txt

class E:
    def __init__(self, txt: str):
        self.y: B = None
        self.txt = txt

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

class G:
    def __init__(self, txt: str):
        self.q: D = None
        self.txt = txt

class H:
    def __init__(self, txt: str):
        self.t: A = None
        self.w: E = None
        self.y: F = None
        self.txt = txt

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

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

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

class B:
    def __init__(self, txt: str):
        self.r: F = None
        self.x: D = None
        self.z: D = None
        self.txt = txt

class C:
    def __init__(self, txt: str):
        self.u: G = None
        self.v: F = None
        self.r: A = None
        self.w: I = None
        self.y: E = None
        self.t: G = None
        self.txt = txt

class D:
    def __init__(self, txt: str):
        self.r: E = None
        self.p: I = None
        self.v: I = None
        self.o: A = None
        self.x: G = None
        self.y: C = None
        self.w: E = None
        self.txt = txt

class E:
    def __init__(self, txt: str):
        self.y: B = None
        self.txt = txt

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

class G:
    def __init__(self, txt: str):
        self.q: D = None
        self.txt = txt

class H:
    def __init__(self, txt: str):
        self.t: A = None
        self.w: E = None
        self.y: F = None
        self.txt = txt

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

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

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