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

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

class C:
    def __init__(self, txt: str):
        self.p: A = None
        self.r: B = None
        self.q: G = None
        self.v: E = None
        self.o: D = None
        self.z: B = None
        self.txt = txt

class D:
    def __init__(self, txt: str):
        self.v: C = None
        self.r: F = None
        self.o: F = None
        self.txt = txt

class E:
    def __init__(self, txt: str):
        self.z: B = None
        self.x: A = None
        self.v: D = None
        self.s: A = None
        self.q: B = None
        self.txt = txt

class F:
    def __init__(self, txt: str):
        self.v: E = None
        self.r: A = None
        self.u: D = None
        self.x: G = None
        self.txt = txt

class G:
    def __init__(self, txt: str):
        self.r: E = None
        self.txt = txt

h = A("h")
e = B("e")
j = C("j")
d = D("d")
a = E("a")
g = F("g")
b = G("b")
i = A("i")

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

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

class C:
    def __init__(self, txt: str):
        self.p: A = None
        self.r: B = None
        self.q: G = None
        self.v: E = None
        self.o: D = None
        self.z: B = None
        self.txt = txt

class D:
    def __init__(self, txt: str):
        self.v: C = None
        self.r: F = None
        self.o: F = None
        self.txt = txt

class E:
    def __init__(self, txt: str):
        self.z: B = None
        self.x: A = None
        self.v: D = None
        self.s: A = None
        self.q: B = None
        self.txt = txt

class F:
    def __init__(self, txt: str):
        self.v: E = None
        self.r: A = None
        self.u: D = None
        self.x: G = None
        self.txt = txt

class G:
    def __init__(self, txt: str):
        self.r: E = None
        self.txt = txt

h = A("h")
e = B("e")
j = C("j")
d = D("d")
a = E("a")
g = F("g")
b = G("b")
i = A("i")

h.x = j
h.t = g
h.q = g
h.r = i
h.u = d
e.u = d
j.p = h
j.r = e
j.z = e
j.q = b
j.v = a
j.o = d
d.v = j
d.r = g
d.o = g
a.z = e
a.q = e
a.x = h
a.s = h
a.v = d
g.v = a
g.r = h
g.u = d
g.x = b
b.r = a
i.x = j
i.t = g
i.q = g
i.r = h
i.u = d
assert j.p.r.t.v.txt == "a"