class A:
    def __init__(self, txt: str):
        self.w: D = None
        self.s: D = None
        self.t: H = None
        self.q: E = None
        self.txt = txt

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

class C:
    def __init__(self, txt: str):
        self.x: D = None
        self.t: F = None
        self.o: B = None
        self.txt = txt

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

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

class F:
    def __init__(self, txt: str):
        self.v: D = None
        self.y: E = None
        self.z: C = None
        self.txt = txt

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

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

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

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

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

class C:
    def __init__(self, txt: str):
        self.x: D = None
        self.t: F = None
        self.o: B = None
        self.txt = txt

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

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

class F:
    def __init__(self, txt: str):
        self.v: D = None
        self.y: E = None
        self.z: C = None
        self.txt = txt

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

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

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

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