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

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

class C:
    def __init__(self, txt: str):
        self.t: E = None
        self.txt = txt

class D:
    def __init__(self, txt: str):
        self.r: A = None
        self.u: A = None
        self.w: F = None
        self.o: E = None
        self.txt = txt

class E:
    def __init__(self, txt: str):
        self.r: D = None
        self.z: D = None
        self.w: C = None
        self.o: D = None
        self.txt = txt

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

class G:
    def __init__(self, txt: str):
        self.y: F = None
        self.r: D = None
        self.x: D = None
        self.txt = txt

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

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

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

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

class C:
    def __init__(self, txt: str):
        self.t: E = None
        self.txt = txt

class D:
    def __init__(self, txt: str):
        self.r: A = None
        self.u: A = None
        self.w: F = None
        self.o: E = None
        self.txt = txt

class E:
    def __init__(self, txt: str):
        self.r: D = None
        self.z: D = None
        self.w: C = None
        self.o: D = None
        self.txt = txt

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

class G:
    def __init__(self, txt: str):
        self.y: F = None
        self.r: D = None
        self.x: D = None
        self.txt = txt

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

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

k.q = m
k.z = m
k.y = g
k.s = l
k.t = j
k.w = j
d.x = k
d.r = m
f.t = b
i.r = k
i.u = k
i.w = l
i.o = b
b.r = i
b.z = i
b.o = i
b.w = j
l.y = f
l.w = k
c.y = l
c.r = i
c.x = i
m.w = j
g.x = k
g.r = m
j.t = b
assert b.w.t.z.w.y.t.w.txt == "j"