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

class B:
    def __init__(self, txt: str):
        self.u: G = None
        self.r: F = None
        self.v: C = None
        self.w: F = None
        self.s: C = None
        self.y: G = None
        self.q: A = None
        self.t: A = None
        self.txt = txt

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

class D:
    def __init__(self, txt: str):
        self.o: G = None
        self.z: D = None
        self.w: D = None
        self.x: H = None
        self.txt = txt

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

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

class G:
    def __init__(self, txt: str):
        self.o: E = None
        self.u: H = None
        self.q: H = None
        self.y: F = None
        self.r: E = None
        self.w: C = None
        self.t: A = None
        self.p: E = None
        self.txt = txt

class H:
    def __init__(self, txt: str):
        self.p: A = None
        self.w: D = None
        self.v: E = None
        self.z: D = None
        self.t: D = None
        self.txt = txt

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

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

class B:
    def __init__(self, txt: str):
        self.u: G = None
        self.r: F = None
        self.v: C = None
        self.w: F = None
        self.s: C = None
        self.y: G = None
        self.q: A = None
        self.t: A = None
        self.txt = txt

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

class D:
    def __init__(self, txt: str):
        self.o: G = None
        self.z: D = None
        self.w: D = None
        self.x: H = None
        self.txt = txt

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

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

class G:
    def __init__(self, txt: str):
        self.o: E = None
        self.u: H = None
        self.q: H = None
        self.y: F = None
        self.r: E = None
        self.w: C = None
        self.t: A = None
        self.p: E = None
        self.txt = txt

class H:
    def __init__(self, txt: str):
        self.p: A = None
        self.w: D = None
        self.v: E = None
        self.z: D = None
        self.t: D = None
        self.txt = txt

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

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