class A:
    def __init__(self, txt: str):
        self.q: D = None
        self.u: G = None
        self.p: I = None
        self.w: D = None
        self.v: E = None
        self.o: H = None
        self.y: H = None
        self.txt = txt

class B:
    def __init__(self, txt: str):
        self.p: C = None
        self.txt = txt

class C:
    def __init__(self, txt: str):
        self.w: A = None
        self.x: G = None
        self.u: A = None
        self.o: D = None
        self.p: G = None
        self.q: H = None
        self.s: F = None
        self.txt = txt

class D:
    def __init__(self, txt: str):
        self.v: C = None
        self.o: F = None
        self.q: D = None
        self.z: I = None
        self.w: I = None
        self.txt = txt

class E:
    def __init__(self, txt: str):
        self.z: A = None
        self.v: H = None
        self.t: G = None
        self.s: D = None
        self.txt = txt

class F:
    def __init__(self, txt: str):
        self.o: I = None
        self.q: G = None
        self.txt = txt

class G:
    def __init__(self, txt: str):
        self.y: H = None
        self.r: H = None
        self.s: I = None
        self.w: D = None
        self.p: B = None
        self.x: B = None
        self.z: I = None
        self.v: B = None
        self.q: C = None
        self.txt = txt

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

class I:
    def __init__(self, txt: str):
        self.v: A = None
        self.txt = txt

a = A("a")
c = B("c")
g = C("g")
e = D("e")
f = E("f")
d = F("d")
j = G("j")
h = H("h")
l = I("l")
n = D("n")

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

class B:
    def __init__(self, txt: str):
        self.p: C = None
        self.txt = txt

class C:
    def __init__(self, txt: str):
        self.w: A = None
        self.x: G = None
        self.u: A = None
        self.o: D = None
        self.p: G = None
        self.q: H = None
        self.s: F = None
        self.txt = txt

class D:
    def __init__(self, txt: str):
        self.v: C = None
        self.o: F = None
        self.q: D = None
        self.z: I = None
        self.w: I = None
        self.txt = txt

class E:
    def __init__(self, txt: str):
        self.z: A = None
        self.v: H = None
        self.t: G = None
        self.s: D = None
        self.txt = txt

class F:
    def __init__(self, txt: str):
        self.o: I = None
        self.q: G = None
        self.txt = txt

class G:
    def __init__(self, txt: str):
        self.y: H = None
        self.r: H = None
        self.s: I = None
        self.w: D = None
        self.p: B = None
        self.x: B = None
        self.z: I = None
        self.v: B = None
        self.q: C = None
        self.txt = txt

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

class I:
    def __init__(self, txt: str):
        self.v: A = None
        self.txt = txt

a = A("a")
c = B("c")
g = C("g")
e = D("e")
f = E("f")
d = F("d")
j = G("j")
h = H("h")
l = I("l")
n = D("n")

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