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

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

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

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

class E:
    def __init__(self, txt: str):
        self.p: B = None
        self.r: G = None
        self.t: D = None
        self.q: G = None
        self.y: G = None
        self.s: A = None
        self.o: C = None
        self.txt = txt

class F:
    def __init__(self, txt: str):
        self.z: D = None
        self.v: A = None
        self.q: C = None
        self.u: A = None
        self.o: B = None
        self.txt = txt

class G:
    def __init__(self, txt: str):
        self.u: B = None
        self.x: F = None
        self.p: F = None
        self.y: E = None
        self.r: D = None
        self.txt = txt

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

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

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

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

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

class E:
    def __init__(self, txt: str):
        self.p: B = None
        self.r: G = None
        self.t: D = None
        self.q: G = None
        self.y: G = None
        self.s: A = None
        self.o: C = None
        self.txt = txt

class F:
    def __init__(self, txt: str):
        self.z: D = None
        self.v: A = None
        self.q: C = None
        self.u: A = None
        self.o: B = None
        self.txt = txt

class G:
    def __init__(self, txt: str):
        self.u: B = None
        self.x: F = None
        self.p: F = None
        self.y: E = None
        self.r: D = None
        self.txt = txt

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

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