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

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

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

class D:
    def __init__(self, txt: str):
        self.x: E = None
        self.v: G = None
        self.y: A = None
        self.o: G = None
        self.txt = txt

class E:
    def __init__(self, txt: str):
        self.v: A = None
        self.z: G = None
        self.w: A = None
        self.p: G = None
        self.y: C = None
        self.r: D = None
        self.o: B = None
        self.txt = txt

class F:
    def __init__(self, txt: str):
        self.p: E = None
        self.u: B = None
        self.t: D = None
        self.w: E = None
        self.q: D = None
        self.txt = txt

class G:
    def __init__(self, txt: str):
        self.p: C = None
        self.r: C = None
        self.o: C = None
        self.w: C = None
        self.t: C = None
        self.u: C = None
        self.txt = txt

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

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

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

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

class D:
    def __init__(self, txt: str):
        self.x: E = None
        self.v: G = None
        self.y: A = None
        self.o: G = None
        self.txt = txt

class E:
    def __init__(self, txt: str):
        self.v: A = None
        self.z: G = None
        self.w: A = None
        self.p: G = None
        self.y: C = None
        self.r: D = None
        self.o: B = None
        self.txt = txt

class F:
    def __init__(self, txt: str):
        self.p: E = None
        self.u: B = None
        self.t: D = None
        self.w: E = None
        self.q: D = None
        self.txt = txt

class G:
    def __init__(self, txt: str):
        self.p: C = None
        self.r: C = None
        self.o: C = None
        self.w: C = None
        self.t: C = None
        self.u: C = None
        self.txt = txt

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

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