class A:
    def __init__(self, txt: str):
        self.r: E = None
        self.y: G = None
        self.u: C = None
        self.s: C = None
        self.z: E = None
        self.v: H = None
        self.w: B = None
        self.txt = txt

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

class C:
    def __init__(self, txt: str):
        self.v: A = None
        self.r: G = None
        self.z: H = None
        self.x: H = None
        self.t: B = None
        self.txt = txt

class D:
    def __init__(self, txt: str):
        self.s: G = None
        self.q: F = None
        self.p: C = None
        self.txt = txt

class E:
    def __init__(self, txt: str):
        self.z: C = None
        self.x: H = None
        self.txt = txt

class F:
    def __init__(self, txt: str):
        self.w: H = None
        self.t: D = None
        self.x: C = None
        self.txt = txt

class G:
    def __init__(self, txt: str):
        self.u: D = None
        self.p: H = None
        self.txt = txt

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

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

a.r = b
a.z = b
a.y = c
a.u = h
a.s = h
a.v = f
a.w = g
g.y = a
g.q = c
h.v = a
h.r = c
h.z = f
h.x = f
h.t = g
l.s = c
l.q = j
l.p = h
b.z = h
b.x = f
j.w = f
j.t = i
j.x = h
c.u = l
c.p = f
f.q = b
f.u = g
f.v = i
i.s = c
i.q = j
i.p = h
assert g.y.v.u.txt == "
class A:
    def __init__(self, txt: str):
        self.r: E = None
        self.y: G = None
        self.u: C = None
        self.s: C = None
        self.z: E = None
        self.v: H = None
        self.w: B = None
        self.txt = txt

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

class C:
    def __init__(self, txt: str):
        self.v: A = None
        self.r: G = None
        self.z: H = None
        self.x: H = None
        self.t: B = None
        self.txt = txt

class D:
    def __init__(self, txt: str):
        self.s: G = None
        self.q: F = None
        self.p: C = None
        self.txt = txt

class E:
    def __init__(self, txt: str):
        self.z: C = None
        self.x: H = None
        self.txt = txt

class F:
    def __init__(self, txt: str):
        self.w: H = None
        self.t: D = None
        self.x: C = None
        self.txt = txt

class G:
    def __init__(self, txt: str):
        self.u: D = None
        self.p: H = None
        self.txt = txt

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

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

a.r = b
a.z = b
a.y = c
a.u = h
a.s = h
a.v = f
a.w = g
g.y = a
g.q = c
h.v = a
h.r = c
h.z = f
h.x = f
h.t = g
l.s = c
l.q = j
l.p = h
b.z = h
b.x = f
j.w = f
j.t = i
j.x = h
c.u = l
c.p = f
f.q = b
f.u = g
f.v = i
i.s = c
i.q = j
i.p = h
assert g.y.v.u.txt == "g"