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

class B:
    def __init__(self, txt: str):
        self.v: A = None
        self.q: B = None
        self.s: D = None
        self.o: E = None
        self.txt = txt

class C:
    def __init__(self, txt: str):
        self.y: H = None
        self.z: E = None
        self.q: A = None
        self.s: G = None
        self.x: D = None
        self.txt = txt

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

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

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

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

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

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

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

class B:
    def __init__(self, txt: str):
        self.v: A = None
        self.q: B = None
        self.s: D = None
        self.o: E = None
        self.txt = txt

class C:
    def __init__(self, txt: str):
        self.y: H = None
        self.z: E = None
        self.q: A = None
        self.s: G = None
        self.x: D = None
        self.txt = txt

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

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

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

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

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

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

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