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

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

class C:
    def __init__(self, txt: str):
        self.t: E = None
        self.w: E = None
        self.o: G = None
        self.r: B = None
        self.q: F = None
        self.s: D = None
        self.txt = txt

class D:
    def __init__(self, txt: str):
        self.t: G = None
        self.txt = txt

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

class F:
    def __init__(self, txt: str):
        self.r: E = None
        self.z: D = None
        self.u: G = None
        self.w: G = None
        self.txt = txt

class G:
    def __init__(self, txt: str):
        self.v: C = None
        self.z: C = None
        self.u: D = None
        self.txt = txt

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

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

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

class C:
    def __init__(self, txt: str):
        self.t: E = None
        self.w: E = None
        self.o: G = None
        self.r: B = None
        self.q: F = None
        self.s: D = None
        self.txt = txt

class D:
    def __init__(self, txt: str):
        self.t: G = None
        self.txt = txt

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

class F:
    def __init__(self, txt: str):
        self.r: E = None
        self.z: D = None
        self.u: G = None
        self.w: G = None
        self.txt = txt

class G:
    def __init__(self, txt: str):
        self.v: C = None
        self.z: C = None
        self.u: D = None
        self.txt = txt

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

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