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

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

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

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

class E:
    def __init__(self, txt: str):
        self.r: G = None
        self.x: B = None
        self.w: D = None
        self.q: G = None
        self.txt = txt

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

class G:
    def __init__(self, txt: str):
        self.o: B = None
        self.txt = txt

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

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

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

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

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

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

class E:
    def __init__(self, txt: str):
        self.r: G = None
        self.x: B = None
        self.w: D = None
        self.q: G = None
        self.txt = txt

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

class G:
    def __init__(self, txt: str):
        self.o: B = None
        self.txt = txt

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

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

l.t = j
l.v = g
l.q = f
m.w = n
m.u = d
m.o = i
g.u = n
f.w = m
f.s = m
f.t = n
f.o = d
f.v = l
f.x = l
d.r = c
d.q = c
d.x = m
d.w = f
h.v = f
c.o = m
n.r = c
i.w = j
i.u = d
i.o = m
j.r = c
assert c.o.o.o.w.r.o.txt == "m"