class A:
    def __init__(self, txt: str):
        self.u: E = None
        self.r: F = None
        self.x: F = None
        self.y: H = None
        self.o: F = None
        self.p: C = None
        self.s: F = None
        self.t: C = None
        self.txt = txt

class B:
    def __init__(self, txt: str):
        self.z: F = None
        self.r: E = None
        self.v: C = None
        self.o: E = None
        self.s: E = None
        self.w: F = None
        self.t: G = None
        self.q: H = None
        self.x: H = None
        self.txt = txt

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

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

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

class F:
    def __init__(self, txt: str):
        self.s: A = None
        self.u: I = None
        self.w: I = None
        self.z: I = None
        self.r: I = None
        self.t: D = None
        self.txt = txt

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

class H:
    def __init__(self, txt: str):
        self.t: D = None
        self.s: I = None
        self.y: E = None
        self.o: I = None
        self.p: D = None
        self.u: B = None
        self.w: B = None
        self.txt = txt

class I:
    def __init__(self, txt: str):
        self.v: G = None
        self.o: G = None
        self.s: H = None
        self.t: H = None
        self.x: E = None
        self.txt = txt

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

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

class B:
    def __init__(self, txt: str):
        self.z: F = None
        self.r: E = None
        self.v: C = None
        self.o: E = None
        self.s: E = None
        self.w: F = None
        self.t: G = None
        self.q: H = None
        self.x: H = None
        self.txt = txt

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

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

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

class F:
    def __init__(self, txt: str):
        self.s: A = None
        self.u: I = None
        self.w: I = None
        self.z: I = None
        self.r: I = None
        self.t: D = None
        self.txt = txt

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

class H:
    def __init__(self, txt: str):
        self.t: D = None
        self.s: I = None
        self.y: E = None
        self.o: I = None
        self.p: D = None
        self.u: B = None
        self.w: B = None
        self.txt = txt

class I:
    def __init__(self, txt: str):
        self.v: G = None
        self.o: G = None
        self.s: H = None
        self.t: H = None
        self.x: E = None
        self.txt = txt

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

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