class A:
    def __init__(self, txt: str):
        self.t: G = None
        self.v: C = None
        self.u: F = None
        self.o: D = None
        self.txt = txt

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

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

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

class E:
    def __init__(self, txt: str):
        self.t: B = None
        self.p: C = None
        self.y: D = None
        self.txt = txt

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

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

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

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

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

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

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

class E:
    def __init__(self, txt: str):
        self.t: B = None
        self.p: C = None
        self.y: D = None
        self.txt = txt

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

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

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

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