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

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

class C:
    def __init__(self, txt: str):
        self.u: B = None
        self.o: F = None
        self.r: F = None
        self.v: F = None
        self.txt = txt

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

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

class F:
    def __init__(self, txt: str):
        self.q: E = None
        self.p: D = None
        self.u: E = None
        self.txt = txt

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

e = A("e")
g = B("g")
h = C("h")
n = D("n")
m = E("m")
j = F("j")
i = G("i")
f = A("f")
d = E("d")
b = F("b")

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

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

class C:
    def __init__(self, txt: str):
        self.u: B = None
        self.o: F = None
        self.r: F = None
        self.v: F = None
        self.txt = txt

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

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

class F:
    def __init__(self, txt: str):
        self.q: E = None
        self.p: D = None
        self.u: E = None
        self.txt = txt

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

e = A("e")
g = B("g")
h = C("h")
n = D("n")
m = E("m")
j = F("j")
i = G("i")
f = A("f")
d = E("d")
b = F("b")

e.y = m
g.y = f
g.q = i
g.z = n
h.u = g
h.o = j
h.r = j
h.v = b
n.p = f
n.x = f
n.s = e
n.z = b
m.p = n
m.z = i
m.q = e
m.u = d
m.v = h
m.t = j
j.q = m
j.u = m
j.p = n
i.o = b
i.y = n
i.s = h
i.v = m
i.z = j
f.y = m
d.p = n
d.z = i
d.q = f
d.u = m
d.v = h
d.t = b
b.q = m
b.u = m
b.p = n
assert f.y.z.o.txt == "b"