class A:
    def __init__(self, txt: str):
        self.p: G = None
        self.q: E = None
        self.x: B = None
        self.r: C = None
        self.z: E = None
        self.t: B = None
        self.y: C = None
        self.txt = txt

class B:
    def __init__(self, txt: str):
        self.s: F = None
        self.u: G = None
        self.z: D = None
        self.y: E = None
        self.q: E = None
        self.p: G = None
        self.o: D = None
        self.txt = txt

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

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

class E:
    def __init__(self, txt: str):
        self.z: F = None
        self.t: G = None
        self.v: G = None
        self.txt = txt

class F:
    def __init__(self, txt: str):
        self.o: C = None
        self.u: D = None
        self.q: A = None
        self.r: E = None
        self.z: E = None
        self.x: G = None
        self.t: D = None
        self.txt = txt

class G:
    def __init__(self, txt: str):
        self.v: F = None
        self.u: A = None
        self.z: A = None
        self.r: B = None
        self.txt = txt

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

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

class B:
    def __init__(self, txt: str):
        self.s: F = None
        self.u: G = None
        self.z: D = None
        self.y: E = None
        self.q: E = None
        self.p: G = None
        self.o: D = None
        self.txt = txt

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

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

class E:
    def __init__(self, txt: str):
        self.z: F = None
        self.t: G = None
        self.v: G = None
        self.txt = txt

class F:
    def __init__(self, txt: str):
        self.o: C = None
        self.u: D = None
        self.q: A = None
        self.r: E = None
        self.z: E = None
        self.x: G = None
        self.t: D = None
        self.txt = txt

class G:
    def __init__(self, txt: str):
        self.v: F = None
        self.u: A = None
        self.z: A = None
        self.r: B = None
        self.txt = txt

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

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