class A:
    def __init__(self, txt: str):
        self.y: G = None
        self.txt = txt

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

class C:
    def __init__(self, txt: str):
        self.p: B = None
        self.txt = txt

class D:
    def __init__(self, txt: str):
        self.o: E = None
        self.w: C = None
        self.s: H = None
        self.u: C = None
        self.txt = txt

class E:
    def __init__(self, txt: str):
        self.o: C = None
        self.p: H = None
        self.txt = txt

class F:
    def __init__(self, txt: str):
        self.r: B = None
        self.w: B = None
        self.txt = txt

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

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

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

h.y = d
i.q = f
i.p = f
i.s = h
i.y = e
i.u = e
i.r = d
c.p = i
e.o = f
e.w = c
e.u = c
e.s = l
f.o = c
f.p = l
n.r = i
n.w = i
d.o = n
d.r = n
d.q = f
l.u = e
l.r = e
l.q = e
l.t = e
l.x = h
b.y = d
assert h.y.o.w.u.s.q.w.txt == "
class A:
    def __init__(self, txt: str):
        self.y: G = None
        self.txt = txt

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

class C:
    def __init__(self, txt: str):
        self.p: B = None
        self.txt = txt

class D:
    def __init__(self, txt: str):
        self.o: E = None
        self.w: C = None
        self.s: H = None
        self.u: C = None
        self.txt = txt

class E:
    def __init__(self, txt: str):
        self.o: C = None
        self.p: H = None
        self.txt = txt

class F:
    def __init__(self, txt: str):
        self.r: B = None
        self.w: B = None
        self.txt = txt

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

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

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

h.y = d
i.q = f
i.p = f
i.s = h
i.y = e
i.u = e
i.r = d
c.p = i
e.o = f
e.w = c
e.u = c
e.s = l
f.o = c
f.p = l
n.r = i
n.w = i
d.o = n
d.r = n
d.q = f
l.u = e
l.r = e
l.q = e
l.t = e
l.x = h
b.y = d
assert h.y.o.w.u.s.q.w.txt == "c"