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

class B:
    def __init__(self, txt: str):
        self.s: E = None
        self.r: D = None
        self.o: D = None
        self.x: A = None
        self.txt = txt

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

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

class E:
    def __init__(self, txt: str):
        self.t: B = None
        self.y: D = None
        self.v: G = None
        self.p: A = None
        self.txt = txt

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

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

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

l = A("l")
g = B("g")
i = C("i")
c = D("c")
e = E("e")
f = F("f")
n = G("n")
a = H("a")
m = B("m")

l.w = i
l.u = a
g.s = e
g.r = c
g.o = c
g.x = l
i.x = n
i.u = e
i.q = l
i.v = c
c.y = i
c.u = l
e.t = g
e.y = c
e.v = n
e.p = l
f.r = a
f.o = a
n.v = e
n.q = e
n.s = m
n.t = m
n.u = g
n.o = a
n.x = i
n.p = l
a.y = f
a.o = g
m.s = e
m.r = c
m.o = c
m.x = l
assert f.o.y.o.y.txt == "
class A:
    def __init__(self, txt: str):
        self.w: C = None
        self.u: H = None
        self.txt = txt

class B:
    def __init__(self, txt: str):
        self.s: E = None
        self.r: D = None
        self.o: D = None
        self.x: A = None
        self.txt = txt

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

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

class E:
    def __init__(self, txt: str):
        self.t: B = None
        self.y: D = None
        self.v: G = None
        self.p: A = None
        self.txt = txt

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

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

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

l = A("l")
g = B("g")
i = C("i")
c = D("c")
e = E("e")
f = F("f")
n = G("n")
a = H("a")
m = B("m")

l.w = i
l.u = a
g.s = e
g.r = c
g.o = c
g.x = l
i.x = n
i.u = e
i.q = l
i.v = c
c.y = i
c.u = l
e.t = g
e.y = c
e.v = n
e.p = l
f.r = a
f.o = a
n.v = e
n.q = e
n.s = m
n.t = m
n.u = g
n.o = a
n.x = i
n.p = l
a.y = f
a.o = g
m.s = e
m.r = c
m.o = c
m.x = l
assert f.o.y.o.y.txt == "f"