class A:
    def __init__(self, txt: str):
        self.p: G = None
        self.q: D = None
        self.t: G = None
        self.r: D = None
        self.u: H = None
        self.y: E = None
        self.txt = txt

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

class C:
    def __init__(self, txt: str):
        self.q: E = None
        self.p: H = None
        self.z: F = None
        self.x: B = None
        self.y: F = None
        self.txt = txt

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

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

class F:
    def __init__(self, txt: str):
        self.q: B = None
        self.s: G = None
        self.w: B = None
        self.v: C = None
        self.r: G = None
        self.x: G = None
        self.y: C = None
        self.txt = txt

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

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

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

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

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

class C:
    def __init__(self, txt: str):
        self.q: E = None
        self.p: H = None
        self.z: F = None
        self.x: B = None
        self.y: F = None
        self.txt = txt

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

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

class F:
    def __init__(self, txt: str):
        self.q: B = None
        self.s: G = None
        self.w: B = None
        self.v: C = None
        self.r: G = None
        self.x: G = None
        self.y: C = None
        self.txt = txt

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

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

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

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