class A:
    def __init__(self, txt: str):
        self.w: C = None
        self.y: C = None
        self.r: E = None
        self.x: F = None
        self.o: G = None
        self.z: C = None
        self.txt = txt

class B:
    def __init__(self, txt: str):
        self.y: C = None
        self.t: F = None
        self.txt = txt

class C:
    def __init__(self, txt: str):
        self.z: A = None
        self.x: C = None
        self.r: E = None
        self.u: D = None
        self.v: F = None
        self.txt = txt

class D:
    def __init__(self, txt: str):
        self.w: F = None
        self.s: E = None
        self.u: B = None
        self.t: B = None
        self.x: B = None
        self.p: E = None
        self.z: F = None
        self.txt = txt

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

class F:
    def __init__(self, txt: str):
        self.s: C = None
        self.z: B = None
        self.v: G = None
        self.txt = txt

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

f = A("f")
k = B("k")
c = C("c")
m = D("m")
j = E("j")
l = F("l")
n = G("n")
h = E("h")
a = C("a")

f.w = c
f.y = c
f.r = h
f.x = l
f.o = n
f.z = a
k.y = c
k.t = l
c.z = f
c.x = a
c.r = h
c.u = m
c.v = l
m.w = l
m.z = l
m.s = h
m.u = k
m.t = k
m.x = k
m.p = j
j.v = a
j.o = n
j.t = f
l.s = a
l.z = k
l.v = n
n.w = f
h.v = a
h.o = n
h.t = f
a.z = f
a.x = c
a.r = j
a.u = m
a.v = l
assert m.w.z.y.v.z.y.r.t.r.txt == "
class A:
    def __init__(self, txt: str):
        self.w: C = None
        self.y: C = None
        self.r: E = None
        self.x: F = None
        self.o: G = None
        self.z: C = None
        self.txt = txt

class B:
    def __init__(self, txt: str):
        self.y: C = None
        self.t: F = None
        self.txt = txt

class C:
    def __init__(self, txt: str):
        self.z: A = None
        self.x: C = None
        self.r: E = None
        self.u: D = None
        self.v: F = None
        self.txt = txt

class D:
    def __init__(self, txt: str):
        self.w: F = None
        self.s: E = None
        self.u: B = None
        self.t: B = None
        self.x: B = None
        self.p: E = None
        self.z: F = None
        self.txt = txt

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

class F:
    def __init__(self, txt: str):
        self.s: C = None
        self.z: B = None
        self.v: G = None
        self.txt = txt

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

f = A("f")
k = B("k")
c = C("c")
m = D("m")
j = E("j")
l = F("l")
n = G("n")
h = E("h")
a = C("a")

f.w = c
f.y = c
f.r = h
f.x = l
f.o = n
f.z = a
k.y = c
k.t = l
c.z = f
c.x = a
c.r = h
c.u = m
c.v = l
m.w = l
m.z = l
m.s = h
m.u = k
m.t = k
m.x = k
m.p = j
j.v = a
j.o = n
j.t = f
l.s = a
l.z = k
l.v = n
n.w = f
h.v = a
h.o = n
h.t = f
a.z = f
a.x = c
a.r = j
a.u = m
a.v = l
assert m.w.z.y.v.z.y.r.t.r.txt == "h"