class A:
    def __init__(self, txt: str):
        self.r: C = None
        self.u: B = None
        self.t: C = None
        self.s: G = None
        self.txt = txt

class B:
    def __init__(self, txt: str):
        self.r: A = None
        self.x: E = None
        self.txt = txt

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

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

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

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

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

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

l.r = i
l.t = i
l.u = j
l.s = b
j.r = l
j.x = k
i.r = n
g.s = i
g.t = k
k.o = b
k.t = i
n.u = g
n.o = j
n.y = k
n.t = l
n.z = i
b.s = l
b.z = l
b.y = g
assert l.u.x.o.y.t.txt == "
class A:
    def __init__(self, txt: str):
        self.r: C = None
        self.u: B = None
        self.t: C = None
        self.s: G = None
        self.txt = txt

class B:
    def __init__(self, txt: str):
        self.r: A = None
        self.x: E = None
        self.txt = txt

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

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

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

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

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

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

l.r = i
l.t = i
l.u = j
l.s = b
j.r = l
j.x = k
i.r = n
g.s = i
g.t = k
k.o = b
k.t = i
n.u = g
n.o = j
n.y = k
n.t = l
n.z = i
b.s = l
b.z = l
b.y = g
assert l.u.x.o.y.t.txt == "k"