class A:
    def __init__(self, txt: str):
        self.o: G = None
        self.txt = txt

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

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

class D:
    def __init__(self, txt: str):
        self.y: E = None
        self.v: B = None
        self.q: E = None
        self.p: G = None
        self.t: B = None
        self.txt = txt

class E:
    def __init__(self, txt: str):
        self.p: F = None
        self.v: G = None
        self.t: A = None
        self.z: F = None
        self.u: F = None
        self.txt = txt

class F:
    def __init__(self, txt: str):
        self.t: D = None
        self.s: E = None
        self.w: F = None
        self.r: G = None
        self.v: G = None
        self.q: C = None
        self.txt = txt

class G:
    def __init__(self, txt: str):
        self.t: B = None
        self.x: D = None
        self.w: B = None
        self.txt = txt

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

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

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

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

class D:
    def __init__(self, txt: str):
        self.y: E = None
        self.v: B = None
        self.q: E = None
        self.p: G = None
        self.t: B = None
        self.txt = txt

class E:
    def __init__(self, txt: str):
        self.p: F = None
        self.v: G = None
        self.t: A = None
        self.z: F = None
        self.u: F = None
        self.txt = txt

class F:
    def __init__(self, txt: str):
        self.t: D = None
        self.s: E = None
        self.w: F = None
        self.r: G = None
        self.v: G = None
        self.q: C = None
        self.txt = txt

class G:
    def __init__(self, txt: str):
        self.t: B = None
        self.x: D = None
        self.w: B = None
        self.txt = txt

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

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