class A:
    def __init__(self, txt: str):
        self.q: D = None
        self.t: B = None
        self.p: B = None
        self.r: G = None
        self.o: D = None
        self.x: G = None
        self.txt = txt

class B:
    def __init__(self, txt: str):
        self.z: D = None
        self.u: D = None
        self.p: A = None
        self.txt = txt

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

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

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

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

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

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

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

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

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

class B:
    def __init__(self, txt: str):
        self.z: D = None
        self.u: D = None
        self.p: A = None
        self.txt = txt

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

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

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

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

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

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

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

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

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