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

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

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

class D:
    def __init__(self, txt: str):
        self.y: B = None
        self.u: B = None
        self.t: A = None
        self.p: C = None
        self.txt = txt

class E:
    def __init__(self, txt: str):
        self.v: G = None
        self.z: G = None
        self.txt = txt

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

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

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

j.z = k
j.v = a
j.u = c
c.w = n
c.r = b
c.v = b
c.p = e
c.t = k
m.u = j
m.q = c
m.y = h
b.y = e
b.u = c
b.t = j
b.p = h
n.v = k
n.z = k
a.v = c
k.w = c
h.u = j
h.q = e
h.y = m
e.w = n
e.r = b
e.v = b
e.p = c
e.t = k
assert e.p.w.z.w.p.t.txt == "
class A:
    def __init__(self, txt: str):
        self.z: G = None
        self.v: F = None
        self.u: B = None
        self.txt = txt

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

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

class D:
    def __init__(self, txt: str):
        self.y: B = None
        self.u: B = None
        self.t: A = None
        self.p: C = None
        self.txt = txt

class E:
    def __init__(self, txt: str):
        self.v: G = None
        self.z: G = None
        self.txt = txt

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

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

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

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