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

class B:
    def __init__(self, txt: str):
        self.v: F = None
        self.s: G = None
        self.y: F = None
        self.txt = txt

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

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

class E:
    def __init__(self, txt: str):
        self.w: G = None
        self.q: C = None
        self.txt = txt

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

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

class H:
    def __init__(self, txt: str):
        self.u: G = None
        self.r: A = None
        self.w: B = None
        self.s: G = None
        self.t: G = None
        self.o: B = None
        self.txt = txt

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

k.w = c
k.u = j
k.p = m
c.v = b
c.y = b
c.s = j
m.w = n
m.s = f
m.z = k
e.u = i
g.w = j
g.q = m
b.r = g
j.s = k
n.u = j
n.s = j
n.t = j
n.r = f
n.w = c
n.o = c
i.u = e
f.w = c
f.u = j
f.p = m
assert c.s.s.u.txt == "
class A:
    def __init__(self, txt: str):
        self.w: B = None
        self.u: G = None
        self.p: C = None
        self.txt = txt

class B:
    def __init__(self, txt: str):
        self.v: F = None
        self.s: G = None
        self.y: F = None
        self.txt = txt

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

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

class E:
    def __init__(self, txt: str):
        self.w: G = None
        self.q: C = None
        self.txt = txt

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

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

class H:
    def __init__(self, txt: str):
        self.u: G = None
        self.r: A = None
        self.w: B = None
        self.s: G = None
        self.t: G = None
        self.o: B = None
        self.txt = txt

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

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