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

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

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

class D:
    def __init__(self, txt: str):
        self.u: F = None
        self.txt = txt

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

class F:
    def __init__(self, txt: str):
        self.u: H = None
        self.z: D = None
        self.s: D = None
        self.t: G = None
        self.txt = txt

class G:
    def __init__(self, txt: str):
        self.r: C = None
        self.u: H = None
        self.q: F = None
        self.p: C = None
        self.z: A = None
        self.w: I = None
        self.o: D = None
        self.y: F = None
        self.txt = txt

class H:
    def __init__(self, txt: str):
        self.y: D = None
        self.o: I = None
        self.q: G = None
        self.s: B = None
        self.x: I = None
        self.p: G = None
        self.r: G = None
        self.w: E = None
        self.txt = txt

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

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

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

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

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

class D:
    def __init__(self, txt: str):
        self.u: F = None
        self.txt = txt

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

class F:
    def __init__(self, txt: str):
        self.u: H = None
        self.z: D = None
        self.s: D = None
        self.t: G = None
        self.txt = txt

class G:
    def __init__(self, txt: str):
        self.r: C = None
        self.u: H = None
        self.q: F = None
        self.p: C = None
        self.z: A = None
        self.w: I = None
        self.o: D = None
        self.y: F = None
        self.txt = txt

class H:
    def __init__(self, txt: str):
        self.y: D = None
        self.o: I = None
        self.q: G = None
        self.s: B = None
        self.x: I = None
        self.p: G = None
        self.r: G = None
        self.w: E = None
        self.txt = txt

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

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

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