class A:
    def __init__(self, txt: str):
        self.r: C = None
        self.y: F = None
        self.z: B = None
        self.w: B = None
        self.txt = txt

class B:
    def __init__(self, txt: str):
        self.x: D = None
        self.txt = txt

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

class D:
    def __init__(self, txt: str):
        self.v: H = None
        self.u: F = None
        self.o: G = None
        self.q: E = None
        self.txt = txt

class E:
    def __init__(self, txt: str):
        self.o: H = None
        self.z: D = None
        self.y: G = None
        self.x: B = None
        self.r: H = None
        self.u: D = None
        self.t: G = None
        self.p: B = None
        self.txt = txt

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

class G:
    def __init__(self, txt: str):
        self.t: A = None
        self.x: H = None
        self.txt = txt

class H:
    def __init__(self, txt: str):
        self.v: E = None
        self.o: E = None
        self.txt = txt

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

c.r = g
c.y = i
c.z = e
c.w = e
e.x = b
g.x = b
g.r = h
g.v = e
b.v = l
b.u = i
b.o = h
b.q = m
m.o = l
m.r = l
m.z = b
m.u = b
m.y = h
m.t = h
m.x = e
m.p = e
j.o = c
j.w = c
j.t = m
j.q = b
j.r = i
j.v = i
j.y = g
h.t = c
h.x = l
l.v = m
l.o = m
i.o = c
i.w = c
i.t = m
i.q = b
i.r = j
i.v = j
i.y = g
assert g.x.v.v.txt == "
class A:
    def __init__(self, txt: str):
        self.r: C = None
        self.y: F = None
        self.z: B = None
        self.w: B = None
        self.txt = txt

class B:
    def __init__(self, txt: str):
        self.x: D = None
        self.txt = txt

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

class D:
    def __init__(self, txt: str):
        self.v: H = None
        self.u: F = None
        self.o: G = None
        self.q: E = None
        self.txt = txt

class E:
    def __init__(self, txt: str):
        self.o: H = None
        self.z: D = None
        self.y: G = None
        self.x: B = None
        self.r: H = None
        self.u: D = None
        self.t: G = None
        self.p: B = None
        self.txt = txt

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

class G:
    def __init__(self, txt: str):
        self.t: A = None
        self.x: H = None
        self.txt = txt

class H:
    def __init__(self, txt: str):
        self.v: E = None
        self.o: E = None
        self.txt = txt

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

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