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

class B:
    def __init__(self, txt: str):
        self.w: C = None
        self.x: E = None
        self.y: E = None
        self.r: E = None
        self.txt = txt

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

class D:
    def __init__(self, txt: str):
        self.p: D = None
        self.u: E = None
        self.z: D = None
        self.txt = txt

class E:
    def __init__(self, txt: str):
        self.z: G = None
        self.txt = txt

class F:
    def __init__(self, txt: str):
        self.r: B = None
        self.t: B = None
        self.w: C = None
        self.z: H = None
        self.o: A = None
        self.v: H = None
        self.q: G = None
        self.txt = txt

class G:
    def __init__(self, txt: str):
        self.v: H = None
        self.txt = txt

class H:
    def __init__(self, txt: str):
        self.s: D = None
        self.x: E = None
        self.v: D = None
        self.w: G = None
        self.txt = txt

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

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

class B:
    def __init__(self, txt: str):
        self.w: C = None
        self.x: E = None
        self.y: E = None
        self.r: E = None
        self.txt = txt

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

class D:
    def __init__(self, txt: str):
        self.p: D = None
        self.u: E = None
        self.z: D = None
        self.txt = txt

class E:
    def __init__(self, txt: str):
        self.z: G = None
        self.txt = txt

class F:
    def __init__(self, txt: str):
        self.r: B = None
        self.t: B = None
        self.w: C = None
        self.z: H = None
        self.o: A = None
        self.v: H = None
        self.q: G = None
        self.txt = txt

class G:
    def __init__(self, txt: str):
        self.v: H = None
        self.txt = txt

class H:
    def __init__(self, txt: str):
        self.s: D = None
        self.x: E = None
        self.v: D = None
        self.w: G = None
        self.txt = txt

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

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