class A:
    def __init__(self, txt: str):
        self.x: E = None
        self.z: D = None
        self.o: G = None
        self.u: D = None
        self.q: D = None
        self.r: E = None
        self.txt = txt

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

class C:
    def __init__(self, txt: str):
        self.y: D = None
        self.txt = txt

class D:
    def __init__(self, txt: str):
        self.r: C = None
        self.o: C = None
        self.q: G = None
        self.v: B = None
        self.txt = txt

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

class F:
    def __init__(self, txt: str):
        self.w: E = None
        self.txt = txt

class G:
    def __init__(self, txt: str):
        self.w: F = None
        self.r: E = None
        self.t: F = None
        self.p: A = None
        self.o: A = None
        self.x: B = None
        self.txt = txt

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

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

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

class C:
    def __init__(self, txt: str):
        self.y: D = None
        self.txt = txt

class D:
    def __init__(self, txt: str):
        self.r: C = None
        self.o: C = None
        self.q: G = None
        self.v: B = None
        self.txt = txt

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

class F:
    def __init__(self, txt: str):
        self.w: E = None
        self.txt = txt

class G:
    def __init__(self, txt: str):
        self.w: F = None
        self.r: E = None
        self.t: F = None
        self.p: A = None
        self.o: A = None
        self.x: B = None
        self.txt = txt

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

d.x = h
d.r = h
d.z = e
d.u = e
d.q = e
d.o = g
j.t = b
j.o = a
j.v = a
j.r = h
j.y = d
m.y = e
e.r = m
e.o = m
e.q = g
e.v = j
h.z = d
h.y = g
b.w = h
g.w = a
g.r = h
g.t = b
g.p = d
g.o = d
g.x = j
a.w = h
assert m.y.o.y.txt == "e"