class A:
    def __init__(self, txt: str):
        self.u: E = None
        self.o: D = None
        self.x: B = None
        self.t: C = None
        self.txt = txt

class B:
    def __init__(self, txt: str):
        self.s: D = None
        self.x: A = None
        self.u: A = None
        self.p: D = None
        self.txt = txt

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

class D:
    def __init__(self, txt: str):
        self.t: A = None
        self.p: E = None
        self.v: C = None
        self.u: B = None
        self.o: B = None
        self.x: A = None
        self.w: F = None
        self.txt = txt

class E:
    def __init__(self, txt: str):
        self.s: C = None
        self.z: F = None
        self.r: G = None
        self.o: D = None
        self.x: F = None
        self.txt = txt

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

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

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

j.u = c
j.o = k
j.x = n
j.t = b
n.s = k
n.p = k
n.x = j
n.u = j
b.y = f
k.t = j
k.x = j
k.p = c
k.v = b
k.u = n
k.o = n
k.w = l
c.s = b
c.z = l
c.x = l
c.r = f
c.o = k
l.r = f
l.w = j
f.t = l
assert c.r.t.w.x.u.txt == "
class A:
    def __init__(self, txt: str):
        self.u: E = None
        self.o: D = None
        self.x: B = None
        self.t: C = None
        self.txt = txt

class B:
    def __init__(self, txt: str):
        self.s: D = None
        self.x: A = None
        self.u: A = None
        self.p: D = None
        self.txt = txt

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

class D:
    def __init__(self, txt: str):
        self.t: A = None
        self.p: E = None
        self.v: C = None
        self.u: B = None
        self.o: B = None
        self.x: A = None
        self.w: F = None
        self.txt = txt

class E:
    def __init__(self, txt: str):
        self.s: C = None
        self.z: F = None
        self.r: G = None
        self.o: D = None
        self.x: F = None
        self.txt = txt

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

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

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

j.u = c
j.o = k
j.x = n
j.t = b
n.s = k
n.p = k
n.x = j
n.u = j
b.y = f
k.t = j
k.x = j
k.p = c
k.v = b
k.u = n
k.o = n
k.w = l
c.s = b
c.z = l
c.x = l
c.r = f
c.o = k
l.r = f
l.w = j
f.t = l
assert c.r.t.w.x.u.txt == "j"