class A:
    def __init__(self, txt: str):
        self.q: B = None
        self.z: G = None
        self.u: B = None
        self.x: F = None
        self.r: C = None
        self.y: C = None
        self.txt = txt

class B:
    def __init__(self, txt: str):
        self.r: G = None
        self.u: G = None
        self.x: A = None
        self.txt = txt

class C:
    def __init__(self, txt: str):
        self.t: E = None
        self.v: B = None
        self.z: E = None
        self.txt = txt

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

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

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

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

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

f.q = a
f.u = a
f.z = n
f.x = j
f.r = m
f.y = m
a.r = n
a.u = n
a.x = f
m.t = c
m.z = c
m.v = a
e.o = n
e.r = j
c.z = m
c.t = e
j.o = c
n.v = f
n.z = e
b.q = a
b.u = a
b.z = n
b.x = j
b.r = m
b.y = m
assert b.z.v.z.z.txt == "
class A:
    def __init__(self, txt: str):
        self.q: B = None
        self.z: G = None
        self.u: B = None
        self.x: F = None
        self.r: C = None
        self.y: C = None
        self.txt = txt

class B:
    def __init__(self, txt: str):
        self.r: G = None
        self.u: G = None
        self.x: A = None
        self.txt = txt

class C:
    def __init__(self, txt: str):
        self.t: E = None
        self.v: B = None
        self.z: E = None
        self.txt = txt

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

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

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

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

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

f.q = a
f.u = a
f.z = n
f.x = j
f.r = m
f.y = m
a.r = n
a.u = n
a.x = f
m.t = c
m.z = c
m.v = a
e.o = n
e.r = j
c.z = m
c.t = e
j.o = c
n.v = f
n.z = e
b.q = a
b.u = a
b.z = n
b.x = j
b.r = m
b.y = m
assert b.z.v.z.z.txt == "e"