class A:
    def __init__(self, txt: str):
        self.p: A = None
        self.q: C = None
        self.s: C = None
        self.z: E = None
        self.x: E = None
        self.txt = txt

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

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

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

class E:
    def __init__(self, txt: str):
        self.t: B = None
        self.q: A = None
        self.v: C = None
        self.y: B = None
        self.txt = txt

c = A("c")
h = B("h")
g = C("g")
b = D("b")
n = E("n")
j = A("j")

c.p = j
c.q = g
c.s = g
c.z = n
c.x = n
h.t = g
h.z = n
g.t = h
g.q = n
g.r = c
b.y = h
n.t = h
n.y = h
n.q = j
n.v = g
j.p = c
j.q = g
j.s = g
j.z = n
j.x = n
assert j.z.v.t.txt == "
class A:
    def __init__(self, txt: str):
        self.p: A = None
        self.q: C = None
        self.s: C = None
        self.z: E = None
        self.x: E = None
        self.txt = txt

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

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

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

class E:
    def __init__(self, txt: str):
        self.t: B = None
        self.q: A = None
        self.v: C = None
        self.y: B = None
        self.txt = txt

c = A("c")
h = B("h")
g = C("g")
b = D("b")
n = E("n")
j = A("j")

c.p = j
c.q = g
c.s = g
c.z = n
c.x = n
h.t = g
h.z = n
g.t = h
g.q = n
g.r = c
b.y = h
n.t = h
n.y = h
n.q = j
n.v = g
j.p = c
j.q = g
j.s = g
j.z = n
j.x = n
assert j.z.v.t.txt == "h"