class A:
    def __init__(self, txt: str):
        self.z: D = None
        self.r: D = None
        self.o: D = None
        self.q: F = None
        self.txt = txt

class B:
    def __init__(self, txt: str):
        self.w: D = None
        self.z: A = None
        self.t: C = None
        self.txt = txt

class C:
    def __init__(self, txt: str):
        self.t: E = None
        self.txt = txt

class D:
    def __init__(self, txt: str):
        self.w: C = None
        self.o: C = None
        self.q: C = None
        self.y: B = None
        self.s: C = None
        self.txt = txt

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

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

class G:
    def __init__(self, txt: str):
        self.o: B = None
        self.v: A = None
        self.t: A = None
        self.txt = txt

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

m.z = j
m.r = j
m.o = j
m.q = c
a.w = j
a.z = m
a.t = i
i.t = g
j.w = i
j.o = i
j.q = i
j.s = i
j.y = a
g.y = h
g.t = i
g.v = j
g.o = d
c.q = g
c.w = g
c.x = a
c.t = d
d.o = a
d.v = m
d.t = m
h.q = g
h.w = g
h.x = a
h.t = d
assert a.z.q.w.t.t.o.txt == "
class A:
    def __init__(self, txt: str):
        self.z: D = None
        self.r: D = None
        self.o: D = None
        self.q: F = None
        self.txt = txt

class B:
    def __init__(self, txt: str):
        self.w: D = None
        self.z: A = None
        self.t: C = None
        self.txt = txt

class C:
    def __init__(self, txt: str):
        self.t: E = None
        self.txt = txt

class D:
    def __init__(self, txt: str):
        self.w: C = None
        self.o: C = None
        self.q: C = None
        self.y: B = None
        self.s: C = None
        self.txt = txt

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

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

class G:
    def __init__(self, txt: str):
        self.o: B = None
        self.v: A = None
        self.t: A = None
        self.txt = txt

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

m.z = j
m.r = j
m.o = j
m.q = c
a.w = j
a.z = m
a.t = i
i.t = g
j.w = i
j.o = i
j.q = i
j.s = i
j.y = a
g.y = h
g.t = i
g.v = j
g.o = d
c.q = g
c.w = g
c.x = a
c.t = d
d.o = a
d.v = m
d.t = m
h.q = g
h.w = g
h.x = a
h.t = d
assert a.z.q.w.t.t.o.txt == "d"