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

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

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

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

class E:
    def __init__(self, txt: str):
        self.q: C = None
        self.w: H = None
        self.r: G = None
        self.u: C = None
        self.txt = txt

class F:
    def __init__(self, txt: str):
        self.p: D = None
        self.w: E = None
        self.x: A = None
        self.t: C = None
        self.s: D = None
        self.v: E = None
        self.txt = txt

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

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

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

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

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

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

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

class E:
    def __init__(self, txt: str):
        self.q: C = None
        self.w: H = None
        self.r: G = None
        self.u: C = None
        self.txt = txt

class F:
    def __init__(self, txt: str):
        self.p: D = None
        self.w: E = None
        self.x: A = None
        self.t: C = None
        self.s: D = None
        self.v: E = None
        self.txt = txt

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

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

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

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