class A:
    def __init__(self, txt: str):
        self.v: C = None
        self.x: F = None
        self.q: C = None
        self.txt = txt

class B:
    def __init__(self, txt: str):
        self.x: D = None
        self.w: E = None
        self.z: C = None
        self.y: E = None
        self.txt = txt

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

class D:
    def __init__(self, txt: str):
        self.y: I = None
        self.t: A = None
        self.txt = txt

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

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

class G:
    def __init__(self, txt: str):
        self.z: B = None
        self.q: C = None
        self.p: E = None
        self.y: E = None
        self.u: C = None
        self.v: D = None
        self.s: F = None
        self.x: C = None
        self.o: E = None
        self.txt = txt

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

class I:
    def __init__(self, txt: str):
        self.t: B = None
        self.z: D = None
        self.txt = txt

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

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

class B:
    def __init__(self, txt: str):
        self.x: D = None
        self.w: E = None
        self.z: C = None
        self.y: E = None
        self.txt = txt

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

class D:
    def __init__(self, txt: str):
        self.y: I = None
        self.t: A = None
        self.txt = txt

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

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

class G:
    def __init__(self, txt: str):
        self.z: B = None
        self.q: C = None
        self.p: E = None
        self.y: E = None
        self.u: C = None
        self.v: D = None
        self.s: F = None
        self.x: C = None
        self.o: E = None
        self.txt = txt

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

class I:
    def __init__(self, txt: str):
        self.t: B = None
        self.z: D = None
        self.txt = txt

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

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