class A:
    def __init__(self, txt: str):
        self.o: C = None
        self.p: D = None
        self.z: D = None
        self.q: E = None
        self.t: G = None
        self.w: C = None
        self.txt = txt

class B:
    def __init__(self, txt: str):
        self.x: E = None
        self.r: C = None
        self.txt = txt

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

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

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

class F:
    def __init__(self, txt: str):
        self.v: A = None
        self.o: C = None
        self.p: C = None
        self.u: E = None
        self.txt = txt

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

a = A("a")
k = B("k")
m = C("m")
n = D("n")
g = E("g")
h = F("h")
f = G("f")
b = A("b")
j = E("j")
d = E("d")

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

class B:
    def __init__(self, txt: str):
        self.x: E = None
        self.r: C = None
        self.txt = txt

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

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

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

class F:
    def __init__(self, txt: str):
        self.v: A = None
        self.o: C = None
        self.p: C = None
        self.u: E = None
        self.txt = txt

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

a = A("a")
k = B("k")
m = C("m")
n = D("n")
g = E("g")
h = F("h")
f = G("f")
b = A("b")
j = E("j")
d = E("d")

a.o = m
a.w = m
a.p = n
a.z = n
a.q = g
a.t = f
k.x = d
k.r = m
m.q = g
n.s = d
g.z = a
g.q = k
h.v = b
h.o = m
h.p = m
h.u = d
f.p = n
f.s = n
f.q = g
b.o = m
b.w = m
b.p = n
b.z = n
b.q = d
b.t = f
j.z = b
j.q = k
d.z = a
d.q = k
assert j.z.w.q.q.txt == "k"