class A:
    def __init__(self, txt: str):
        self.t: G = None
        self.r: H = None
        self.o: B = None
        self.z: E = None
        self.x: G = None
        self.txt = txt

class B:
    def __init__(self, txt: str):
        self.u: G = None
        self.x: C = None
        self.s: E = None
        self.t: I = None
        self.txt = txt

class C:
    def __init__(self, txt: str):
        self.w: H = None
        self.txt = txt

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

class E:
    def __init__(self, txt: str):
        self.s: G = None
        self.u: A = None
        self.y: F = None
        self.w: B = None
        self.q: D = None
        self.txt = txt

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

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

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

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

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

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

class B:
    def __init__(self, txt: str):
        self.u: G = None
        self.x: C = None
        self.s: E = None
        self.t: I = None
        self.txt = txt

class C:
    def __init__(self, txt: str):
        self.w: H = None
        self.txt = txt

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

class E:
    def __init__(self, txt: str):
        self.s: G = None
        self.u: A = None
        self.y: F = None
        self.w: B = None
        self.q: D = None
        self.txt = txt

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

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

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

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

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

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