class A:
    def __init__(self, txt: str):
        self.o: E = None
        self.v: D = None
        self.r: F = None
        self.w: F = None
        self.x: B = None
        self.txt = txt

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

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

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

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

class F:
    def __init__(self, txt: str):
        self.x: E = None
        self.v: E = None
        self.o: B = None
        self.t: G = None
        self.z: C = None
        self.w: B = None
        self.txt = txt

class G:
    def __init__(self, txt: str):
        self.r: F = None
        self.txt = txt

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

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

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

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

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

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

class F:
    def __init__(self, txt: str):
        self.x: E = None
        self.v: E = None
        self.o: B = None
        self.t: G = None
        self.z: C = None
        self.w: B = None
        self.txt = txt

class G:
    def __init__(self, txt: str):
        self.r: F = None
        self.txt = txt

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

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