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

class B:
    def __init__(self, txt: str):
        self.p: F = None
        self.o: A = None
        self.z: D = None
        self.q: E = None
        self.s: A = None
        self.x: F = None
        self.txt = txt

class C:
    def __init__(self, txt: str):
        self.r: B = None
        self.v: G = None
        self.z: F = None
        self.u: E = None
        self.s: B = None
        self.txt = txt

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

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

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

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

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

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

class B:
    def __init__(self, txt: str):
        self.p: F = None
        self.o: A = None
        self.z: D = None
        self.q: E = None
        self.s: A = None
        self.x: F = None
        self.txt = txt

class C:
    def __init__(self, txt: str):
        self.r: B = None
        self.v: G = None
        self.z: F = None
        self.u: E = None
        self.s: B = None
        self.txt = txt

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

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

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

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

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

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