class A:
    def __init__(self, txt: str):
        self.r: D = None
        self.v: B = None
        self.w: A = None
        self.q: G = None
        self.t: D = None
        self.txt = txt

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

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

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

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

class F:
    def __init__(self, txt: str):
        self.x: G = None
        self.w: E = None
        self.txt = txt

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

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

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

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

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

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

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

class F:
    def __init__(self, txt: str):
        self.x: G = None
        self.w: E = None
        self.txt = txt

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

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

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