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

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

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

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

class E:
    def __init__(self, txt: str):
        self.z: A = None
        self.p: C = None
        self.x: C = None
        self.y: C = None
        self.txt = txt

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

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

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

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

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

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

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

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

class E:
    def __init__(self, txt: str):
        self.z: A = None
        self.p: C = None
        self.x: C = None
        self.y: C = None
        self.txt = txt

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

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

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

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

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