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

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

class C:
    def __init__(self, txt: str):
        self.y: B = None
        self.p: F = None
        self.w: F = None
        self.u: D = None
        self.x: E = None
        self.txt = txt

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

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

class F:
    def __init__(self, txt: str):
        self.q: E = None
        self.r: G = None
        self.o: A = None
        self.z: C = None
        self.txt = txt

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

k = A("k")
d = B("d")
l = C("l")
c = D("c")
i = E("i")
j = F("j")
a = G("a")
g = A("g")

k.z = g
k.r = g
k.p = i
k.w = c
k.q = l
k.o = a
d.o = j
d.w = i
l.y = d
l.p = j
l.w = j
l.u = c
l.x = i
c.x = a
c.r = a
c.q = g
i.o = c
j.q = i
j.r = a
j.o = g
j.z = l
a.x = i
a.y = i
a.v = g
a.z = j
g.z = k
g.r = k
g.p = i
g.w = c
g.q = l
g.o = a
assert l.w.o.p.o.r.z.o.txt == "
class A:
    def __init__(self, txt: str):
        self.z: A = None
        self.p: E = None
        self.w: D = None
        self.r: A = None
        self.q: C = None
        self.o: G = None
        self.txt = txt

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

class C:
    def __init__(self, txt: str):
        self.y: B = None
        self.p: F = None
        self.w: F = None
        self.u: D = None
        self.x: E = None
        self.txt = txt

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

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

class F:
    def __init__(self, txt: str):
        self.q: E = None
        self.r: G = None
        self.o: A = None
        self.z: C = None
        self.txt = txt

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

k = A("k")
d = B("d")
l = C("l")
c = D("c")
i = E("i")
j = F("j")
a = G("a")
g = A("g")

k.z = g
k.r = g
k.p = i
k.w = c
k.q = l
k.o = a
d.o = j
d.w = i
l.y = d
l.p = j
l.w = j
l.u = c
l.x = i
c.x = a
c.r = a
c.q = g
i.o = c
j.q = i
j.r = a
j.o = g
j.z = l
a.x = i
a.y = i
a.v = g
a.z = j
g.z = k
g.r = k
g.p = i
g.w = c
g.q = l
g.o = a
assert l.w.o.p.o.r.z.o.txt == "g"