class A:
    def __init__(self, txt: str):
        self.w: F = None
        self.s: G = None
        self.y: G = None
        self.u: E = None
        self.txt = txt

class B:
    def __init__(self, txt: str):
        self.p: C = None
        self.o: E = None
        self.w: H = None
        self.s: G = None
        self.u: A = None
        self.x: G = None
        self.txt = txt

class C:
    def __init__(self, txt: str):
        self.s: H = None
        self.x: A = None
        self.p: B = None
        self.q: F = None
        self.v: H = None
        self.txt = txt

class D:
    def __init__(self, txt: str):
        self.o: A = None
        self.q: C = None
        self.r: G = None
        self.u: E = None
        self.txt = txt

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

class F:
    def __init__(self, txt: str):
        self.z: B = None
        self.q: C = None
        self.w: G = None
        self.r: H = None
        self.u: C = None
        self.v: D = None
        self.txt = txt

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

class H:
    def __init__(self, txt: str):
        self.t: A = None
        self.txt = txt

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

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

class B:
    def __init__(self, txt: str):
        self.p: C = None
        self.o: E = None
        self.w: H = None
        self.s: G = None
        self.u: A = None
        self.x: G = None
        self.txt = txt

class C:
    def __init__(self, txt: str):
        self.s: H = None
        self.x: A = None
        self.p: B = None
        self.q: F = None
        self.v: H = None
        self.txt = txt

class D:
    def __init__(self, txt: str):
        self.o: A = None
        self.q: C = None
        self.r: G = None
        self.u: E = None
        self.txt = txt

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

class F:
    def __init__(self, txt: str):
        self.z: B = None
        self.q: C = None
        self.w: G = None
        self.r: H = None
        self.u: C = None
        self.v: D = None
        self.txt = txt

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

class H:
    def __init__(self, txt: str):
        self.t: A = None
        self.txt = txt

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

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