class A:
    def __init__(self, txt: str):
        self.t: D = None
        self.txt = txt

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

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

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

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

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

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

n = A("n")
c = B("c")
l = C("l")
e = D("e")
k = E("k")
b = F("b")
h = G("h")
g = E("g")

n.t = e
c.o = b
c.s = k
l.x = k
l.p = b
e.w = l
e.r = h
e.t = c
e.s = c
k.q = n
k.v = e
k.x = c
b.r = l
b.t = l
b.p = e
b.y = e
b.v = h
h.s = e
h.x = c
h.q = n
g.q = n
g.v = e
g.x = c
assert l.x.v.w.txt == "
class A:
    def __init__(self, txt: str):
        self.t: D = None
        self.txt = txt

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

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

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

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

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

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

n = A("n")
c = B("c")
l = C("l")
e = D("e")
k = E("k")
b = F("b")
h = G("h")
g = E("g")

n.t = e
c.o = b
c.s = k
l.x = k
l.p = b
e.w = l
e.r = h
e.t = c
e.s = c
k.q = n
k.v = e
k.x = c
b.r = l
b.t = l
b.p = e
b.y = e
b.v = h
h.s = e
h.x = c
h.q = n
g.q = n
g.v = e
g.x = c
assert l.x.v.w.txt == "l"