class A:
    def __init__(self, txt: str):
        self.t: D = None
        self.w: C = None
        self.o: B = None
        self.q: E = None
        self.v: H = None
        self.txt = txt

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

class C:
    def __init__(self, txt: str):
        self.v: B = None
        self.txt = txt

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

class E:
    def __init__(self, txt: str):
        self.y: A = None
        self.v: H = None
        self.s: B = None
        self.txt = txt

class F:
    def __init__(self, txt: str):
        self.v: C = None
        self.txt = txt

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

class H:
    def __init__(self, txt: str):
        self.z: E = None
        self.y: D = None
        self.w: E = None
        self.txt = txt

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

j.t = l
j.w = m
j.o = k
j.q = f
j.v = n
k.r = m
k.w = m
m.v = k
l.w = f
l.y = g
f.y = j
f.v = n
f.s = k
b.v = m
g.y = j
n.z = f
n.w = f
n.y = l
assert g.y.o.w.txt == "
class A:
    def __init__(self, txt: str):
        self.t: D = None
        self.w: C = None
        self.o: B = None
        self.q: E = None
        self.v: H = None
        self.txt = txt

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

class C:
    def __init__(self, txt: str):
        self.v: B = None
        self.txt = txt

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

class E:
    def __init__(self, txt: str):
        self.y: A = None
        self.v: H = None
        self.s: B = None
        self.txt = txt

class F:
    def __init__(self, txt: str):
        self.v: C = None
        self.txt = txt

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

class H:
    def __init__(self, txt: str):
        self.z: E = None
        self.y: D = None
        self.w: E = None
        self.txt = txt

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

j.t = l
j.w = m
j.o = k
j.q = f
j.v = n
k.r = m
k.w = m
m.v = k
l.w = f
l.y = g
f.y = j
f.v = n
f.s = k
b.v = m
g.y = j
n.z = f
n.w = f
n.y = l
assert g.y.o.w.txt == "m"