class A:
    def __init__(self, txt: str):
        self.u: G = None
        self.w: F = None
        self.t: D = None
        self.s: C = None
        self.p: B = None
        self.txt = txt

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

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

class D:
    def __init__(self, txt: str):
        self.v: H = None
        self.s: H = None
        self.txt = txt

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

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

class G:
    def __init__(self, txt: str):
        self.v: H = None
        self.t: H = None
        self.p: F = None
        self.y: C = None
        self.txt = txt

class H:
    def __init__(self, txt: str):
        self.w: B = None
        self.p: D = None
        self.txt = txt

c = A("c")
i = B("i")
g = C("g")
m = D("m")
n = E("n")
f = F("f")
l = G("l")
e = H("e")
d = F("d")

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

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

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

class D:
    def __init__(self, txt: str):
        self.v: H = None
        self.s: H = None
        self.txt = txt

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

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

class G:
    def __init__(self, txt: str):
        self.v: H = None
        self.t: H = None
        self.p: F = None
        self.y: C = None
        self.txt = txt

class H:
    def __init__(self, txt: str):
        self.w: B = None
        self.p: D = None
        self.txt = txt

c = A("c")
i = B("i")
g = C("g")
m = D("m")
n = E("n")
f = F("f")
l = G("l")
e = H("e")
d = F("d")

c.u = l
c.w = d
c.t = m
c.s = g
c.p = i
i.r = m
i.u = g
i.t = g
g.q = i
g.y = l
g.p = n
g.x = m
m.v = e
m.s = e
n.r = c
n.v = l
f.t = m
f.u = d
l.v = e
l.t = e
l.p = f
l.y = g
e.w = i
e.p = m
d.t = m
d.u = f
assert c.u.p.u.u.t.v.w.u.p.txt == "n"