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

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

class C:
    def __init__(self, txt: str):
        self.z: G = None
        self.o: D = None
        self.t: B = None
        self.txt = txt

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

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

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

class G:
    def __init__(self, txt: str):
        self.v: D = None
        self.q: C = None
        self.z: B = None
        self.t: C = None
        self.p: F = None
        self.txt = txt

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

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

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

class C:
    def __init__(self, txt: str):
        self.z: G = None
        self.o: D = None
        self.t: B = None
        self.txt = txt

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

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

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

class G:
    def __init__(self, txt: str):
        self.v: D = None
        self.q: C = None
        self.z: B = None
        self.t: C = None
        self.p: F = None
        self.txt = txt

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

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