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

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

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

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

class E:
    def __init__(self, txt: str):
        self.z: F = None
        self.o: B = None
        self.t: G = None
        self.u: C = None
        self.q: F = None
        self.y: A = None
        self.txt = txt

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

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

a = A("a")
d = B("d")
j = C("j")
k = D("k")
i = E("i")
l = F("l")
e = G("e")
b = F("b")
c = D("c")

a.r = k
a.y = e
d.s = a
d.w = a
d.z = b
d.q = b
d.r = j
j.s = d
k.w = a
i.z = l
i.o = d
i.t = e
i.u = j
i.q = b
i.y = a
l.x = j
e.t = j
e.q = d
e.w = d
b.x = j
c.w = a
assert l.x.s.w.r.w.y.t.txt == "
class A:
    def __init__(self, txt: str):
        self.r: D = None
        self.y: G = None
        self.txt = txt

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

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

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

class E:
    def __init__(self, txt: str):
        self.z: F = None
        self.o: B = None
        self.t: G = None
        self.u: C = None
        self.q: F = None
        self.y: A = None
        self.txt = txt

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

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

a = A("a")
d = B("d")
j = C("j")
k = D("k")
i = E("i")
l = F("l")
e = G("e")
b = F("b")
c = D("c")

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