class A:
    def __init__(self, txt: str):
        self.z: G = None
        self.r: H = None
        self.s: G = None
        self.y: H = None
        self.q: D = None
        self.x: F = None
        self.p: E = None
        self.t: B = None
        self.txt = txt

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

class C:
    def __init__(self, txt: str):
        self.p: E = None
        self.w: D = None
        self.v: D = None
        self.txt = txt

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

class E:
    def __init__(self, txt: str):
        self.z: B = None
        self.o: A = None
        self.q: C = None
        self.txt = txt

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

class G:
    def __init__(self, txt: str):
        self.p: H = None
        self.s: C = None
        self.w: H = None
        self.txt = txt

class H:
    def __init__(self, txt: str):
        self.z: C = None
        self.s: C = None
        self.t: F = None
        self.txt = txt

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

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

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

class C:
    def __init__(self, txt: str):
        self.p: E = None
        self.w: D = None
        self.v: D = None
        self.txt = txt

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

class E:
    def __init__(self, txt: str):
        self.z: B = None
        self.o: A = None
        self.q: C = None
        self.txt = txt

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

class G:
    def __init__(self, txt: str):
        self.p: H = None
        self.s: C = None
        self.w: H = None
        self.txt = txt

class H:
    def __init__(self, txt: str):
        self.z: C = None
        self.s: C = None
        self.t: F = None
        self.txt = txt

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

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