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

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

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

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

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

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

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

l = A("l")
b = B("b")
d = C("d")
m = D("m")
g = E("g")
n = F("n")
a = G("a")
k = E("k")
c = D("c")

l.t = d
l.r = d
l.x = n
l.w = n
l.o = a
b.p = n
b.w = n
d.t = b
d.s = l
m.w = l
m.y = n
m.o = b
g.y = d
g.u = d
g.z = k
g.p = a
n.t = d
n.z = d
a.x = l
a.r = d
a.y = g
k.y = d
k.u = d
k.z = g
k.p = a
c.w = l
c.y = n
c.o = b
assert n.t.s.r.s.o.txt == "
class A:
    def __init__(self, txt: str):
        self.t: C = None
        self.x: F = None
        self.w: F = None
        self.o: G = None
        self.r: C = None
        self.txt = txt

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

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

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

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

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

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

l = A("l")
b = B("b")
d = C("d")
m = D("m")
g = E("g")
n = F("n")
a = G("a")
k = E("k")
c = D("c")

l.t = d
l.r = d
l.x = n
l.w = n
l.o = a
b.p = n
b.w = n
d.t = b
d.s = l
m.w = l
m.y = n
m.o = b
g.y = d
g.u = d
g.z = k
g.p = a
n.t = d
n.z = d
a.x = l
a.r = d
a.y = g
k.y = d
k.u = d
k.z = g
k.p = a
c.w = l
c.y = n
c.o = b
assert n.t.s.r.s.o.txt == "a"