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

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

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

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

class E:
    def __init__(self, txt: str):
        self.o: F = None
        self.q: B = None
        self.y: B = None
        self.r: B = None
        self.v: F = None
        self.txt = txt

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

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

g = A("g")
c = B("c")
f = C("f")
j = D("j")
i = E("i")
k = F("k")
m = G("m")
l = B("l")
b = A("b")

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

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

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

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

class E:
    def __init__(self, txt: str):
        self.o: F = None
        self.q: B = None
        self.y: B = None
        self.r: B = None
        self.v: F = None
        self.txt = txt

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

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

g = A("g")
c = B("c")
f = C("f")
j = D("j")
i = E("i")
k = F("k")
m = G("m")
l = B("l")
b = A("b")

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