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

class B:
    def __init__(self, txt: str):
        self.y: F = None
        self.txt = txt

class C:
    def __init__(self, txt: str):
        self.y: D = None
        self.txt = txt

class D:
    def __init__(self, txt: str):
        self.p: C = None
        self.x: F = None
        self.u: A = None
        self.v: B = None
        self.y: G = None
        self.txt = txt

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

class F:
    def __init__(self, txt: str):
        self.t: E = None
        self.q: E = None
        self.v: D = None
        self.y: A = None
        self.r: C = None
        self.txt = txt

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

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

d.u = a
d.w = a
j.y = g
i.y = l
l.p = i
l.x = g
l.u = d
l.v = j
l.y = k
a.v = j
a.q = j
g.t = a
g.q = a
g.v = l
g.y = d
g.r = i
k.o = a
k.q = j
k.s = j
assert i.y.x.t.txt == "
class A:
    def __init__(self, txt: str):
        self.u: E = None
        self.w: E = None
        self.txt = txt

class B:
    def __init__(self, txt: str):
        self.y: F = None
        self.txt = txt

class C:
    def __init__(self, txt: str):
        self.y: D = None
        self.txt = txt

class D:
    def __init__(self, txt: str):
        self.p: C = None
        self.x: F = None
        self.u: A = None
        self.v: B = None
        self.y: G = None
        self.txt = txt

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

class F:
    def __init__(self, txt: str):
        self.t: E = None
        self.q: E = None
        self.v: D = None
        self.y: A = None
        self.r: C = None
        self.txt = txt

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

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

d.u = a
d.w = a
j.y = g
i.y = l
l.p = i
l.x = g
l.u = d
l.v = j
l.y = k
a.v = j
a.q = j
g.t = a
g.q = a
g.v = l
g.y = d
g.r = i
k.o = a
k.q = j
k.s = j
assert i.y.x.t.txt == "a"