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

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

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

class D:
    def __init__(self, txt: str):
        self.v: F = None
        self.r: B = None
        self.t: C = None
        self.s: F = None
        self.z: E = None
        self.txt = txt

class E:
    def __init__(self, txt: str):
        self.w: D = None
        self.s: C = None
        self.p: A = None
        self.q: F = None
        self.txt = txt

class F:
    def __init__(self, txt: str):
        self.p: G = None
        self.o: E = None
        self.txt = txt

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

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

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

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

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

class D:
    def __init__(self, txt: str):
        self.v: F = None
        self.r: B = None
        self.t: C = None
        self.s: F = None
        self.z: E = None
        self.txt = txt

class E:
    def __init__(self, txt: str):
        self.w: D = None
        self.s: C = None
        self.p: A = None
        self.q: F = None
        self.txt = txt

class F:
    def __init__(self, txt: str):
        self.p: G = None
        self.o: E = None
        self.txt = txt

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

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

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