class A:
    def __init__(self, txt: str):
        self.p: C = None
        self.x: I = None
        self.z: B = None
        self.u: I = None
        self.t: C = None
        self.txt = txt

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

class C:
    def __init__(self, txt: str):
        self.q: G = None
        self.s: G = None
        self.u: H = None
        self.z: H = None
        self.txt = txt

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

class E:
    def __init__(self, txt: str):
        self.v: H = None
        self.p: C = None
        self.y: A = None
        self.s: H = None
        self.w: C = None
        self.txt = txt

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

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

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

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

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

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

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

class C:
    def __init__(self, txt: str):
        self.q: G = None
        self.s: G = None
        self.u: H = None
        self.z: H = None
        self.txt = txt

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

class E:
    def __init__(self, txt: str):
        self.v: H = None
        self.p: C = None
        self.y: A = None
        self.s: H = None
        self.w: C = None
        self.txt = txt

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

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

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

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

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

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