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

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

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

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

class E:
    def __init__(self, txt: str):
        self.r: D = None
        self.z: G = None
        self.q: A = None
        self.o: D = None
        self.u: G = None
        self.txt = txt

class F:
    def __init__(self, txt: str):
        self.s: E = None
        self.txt = txt

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

class H:
    def __init__(self, txt: str):
        self.x: F = None
        self.p: F = None
        self.q: I = None
        self.txt = txt

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

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

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

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

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

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

class E:
    def __init__(self, txt: str):
        self.r: D = None
        self.z: G = None
        self.q: A = None
        self.o: D = None
        self.u: G = None
        self.txt = txt

class F:
    def __init__(self, txt: str):
        self.s: E = None
        self.txt = txt

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

class H:
    def __init__(self, txt: str):
        self.x: F = None
        self.p: F = None
        self.q: I = None
        self.txt = txt

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

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

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