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

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

class C:
    def __init__(self, txt: str):
        self.s: E = None
        self.o: E = None
        self.p: F = None
        self.y: G = None
        self.w: D = None
        self.txt = txt

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

class E:
    def __init__(self, txt: str):
        self.z: A = None
        self.y: A = None
        self.txt = txt

class F:
    def __init__(self, txt: str):
        self.v: C = None
        self.txt = txt

class G:
    def __init__(self, txt: str):
        self.o: C = None
        self.s: C = None
        self.t: D = None
        self.txt = txt

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

e.q = b
e.t = m
e.x = j
e.z = j
e.v = f
e.o = f
i.s = m
i.t = m
i.q = e
a.s = m
a.o = m
a.p = b
a.y = j
a.w = f
f.q = e
m.z = e
m.y = e
b.v = a
j.o = a
j.s = a
j.t = f
assert f.q.o.q.z.txt == "
class A:
    def __init__(self, txt: str):
        self.q: F = None
        self.t: E = None
        self.x: G = None
        self.v: D = None
        self.o: D = None
        self.z: G = None
        self.txt = txt

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

class C:
    def __init__(self, txt: str):
        self.s: E = None
        self.o: E = None
        self.p: F = None
        self.y: G = None
        self.w: D = None
        self.txt = txt

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

class E:
    def __init__(self, txt: str):
        self.z: A = None
        self.y: A = None
        self.txt = txt

class F:
    def __init__(self, txt: str):
        self.v: C = None
        self.txt = txt

class G:
    def __init__(self, txt: str):
        self.o: C = None
        self.s: C = None
        self.t: D = None
        self.txt = txt

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

e.q = b
e.t = m
e.x = j
e.z = j
e.v = f
e.o = f
i.s = m
i.t = m
i.q = e
a.s = m
a.o = m
a.p = b
a.y = j
a.w = f
f.q = e
m.z = e
m.y = e
b.v = a
j.o = a
j.s = a
j.t = f
assert f.q.o.q.z.txt == "j"