class A:
    def __init__(self, txt: str):
        self.r: C = None
        self.z: F = None
        self.u: C = None
        self.txt = txt

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

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

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

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

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

class G:
    def __init__(self, txt: str):
        self.w: F = None
        self.txt = txt

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

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

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

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

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

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

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

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

class G:
    def __init__(self, txt: str):
        self.w: F = None
        self.txt = txt

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

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

a.r = j
a.u = j
a.z = b
g.x = i
g.q = i
g.t = a
g.w = h
j.x = g
h.r = i
d.s = a
b.r = a
i.w = b
k.w = f
k.o = f
k.v = j
f.w = k
f.o = k
f.v = j
l.s = a
assert d.s.u.x.t.r.txt == "j"