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

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

class C:
    def __init__(self, txt: str):
        self.w: A = None
        self.t: F = None
        self.txt = txt

class D:
    def __init__(self, txt: str):
        self.z: C = None
        self.q: C = None
        self.txt = txt

class E:
    def __init__(self, txt: str):
        self.p: B = None
        self.u: B = None
        self.s: F = None
        self.txt = txt

class F:
    def __init__(self, txt: str):
        self.u: D = None
        self.w: E = None
        self.t: C = None
        self.y: E = None
        self.txt = txt

n = A("n")
l = B("l")
g = C("g")
c = D("c")
i = E("i")
h = F("h")
d = A("d")

n.t = c
n.s = l
n.p = d
l.w = i
l.x = h
l.q = n
l.z = g
l.t = g
l.y = c
g.w = d
g.t = h
c.z = g
c.q = g
i.p = l
i.u = l
i.s = h
h.u = c
h.w = i
h.y = i
h.t = g
d.t = c
d.s = l
d.p = n
assert i.s.u.q.t.u.q.txt == "
class A:
    def __init__(self, txt: str):
        self.t: D = None
        self.s: B = None
        self.p: A = None
        self.txt = txt

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

class C:
    def __init__(self, txt: str):
        self.w: A = None
        self.t: F = None
        self.txt = txt

class D:
    def __init__(self, txt: str):
        self.z: C = None
        self.q: C = None
        self.txt = txt

class E:
    def __init__(self, txt: str):
        self.p: B = None
        self.u: B = None
        self.s: F = None
        self.txt = txt

class F:
    def __init__(self, txt: str):
        self.u: D = None
        self.w: E = None
        self.t: C = None
        self.y: E = None
        self.txt = txt

n = A("n")
l = B("l")
g = C("g")
c = D("c")
i = E("i")
h = F("h")
d = A("d")

n.t = c
n.s = l
n.p = d
l.w = i
l.x = h
l.q = n
l.z = g
l.t = g
l.y = c
g.w = d
g.t = h
c.z = g
c.q = g
i.p = l
i.u = l
i.s = h
h.u = c
h.w = i
h.y = i
h.t = g
d.t = c
d.s = l
d.p = n
assert i.s.u.q.t.u.q.txt == "g"