class A:
    def __init__(self, txt: str):
        self.t: G = None
        self.r: D = None
        self.x: E = None
        self.p: H = None
        self.s: B = None
        self.w: B = None
        self.txt = txt

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

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

class D:
    def __init__(self, txt: str):
        self.s: G = None
        self.u: A = None
        self.p: C = None
        self.txt = txt

class E:
    def __init__(self, txt: str):
        self.u: F = None
        self.v: F = None
        self.w: C = None
        self.o: C = None
        self.txt = txt

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

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

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

g = A("g")
m = B("m")
c = C("c")
a = D("a")
e = E("e")
d = F("d")
i = G("i")
b = H("b")
k = E("k")
f = G("f")

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

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

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

class D:
    def __init__(self, txt: str):
        self.s: G = None
        self.u: A = None
        self.p: C = None
        self.txt = txt

class E:
    def __init__(self, txt: str):
        self.u: F = None
        self.v: F = None
        self.w: C = None
        self.o: C = None
        self.txt = txt

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

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

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

g = A("g")
m = B("m")
c = C("c")
a = D("a")
e = E("e")
d = F("d")
i = G("i")
b = H("b")
k = E("k")
f = G("f")

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