class A:
    def __init__(self, txt: str):
        self.w: E = None
        self.u: C = None
        self.p: C = None
        self.txt = txt

class B:
    def __init__(self, txt: str):
        self.r: A = None
        self.y: E = None
        self.t: G = None
        self.txt = txt

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

class D:
    def __init__(self, txt: str):
        self.p: B = None
        self.txt = txt

class E:
    def __init__(self, txt: str):
        self.z: B = None
        self.y: C = None
        self.q: A = None
        self.v: A = None
        self.txt = txt

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

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

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

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

class B:
    def __init__(self, txt: str):
        self.r: A = None
        self.y: E = None
        self.t: G = None
        self.txt = txt

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

class D:
    def __init__(self, txt: str):
        self.p: B = None
        self.txt = txt

class E:
    def __init__(self, txt: str):
        self.z: B = None
        self.y: C = None
        self.q: A = None
        self.v: A = None
        self.txt = txt

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

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

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

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