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

class B:
    def __init__(self, txt: str):
        self.r: G = None
        self.p: C = None
        self.txt = txt

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

class D:
    def __init__(self, txt: str):
        self.v: F = None
        self.r: G = None
        self.p: G = None
        self.q: B = None
        self.txt = txt

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

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

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

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

c.w = j
l.r = a
l.p = i
i.r = j
f.v = n
f.r = a
f.p = b
f.q = l
m.x = f
n.y = f
n.q = f
n.x = l
n.v = l
n.p = l
n.t = a
n.u = i
a.v = b
j.w = c
b.v = a
assert a.v.v.v.v.v.v.v.v.txt == "
class A:
    def __init__(self, txt: str):
        self.w: A = None
        self.txt = txt

class B:
    def __init__(self, txt: str):
        self.r: G = None
        self.p: C = None
        self.txt = txt

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

class D:
    def __init__(self, txt: str):
        self.v: F = None
        self.r: G = None
        self.p: G = None
        self.q: B = None
        self.txt = txt

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

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

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

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

c.w = j
l.r = a
l.p = i
i.r = j
f.v = n
f.r = a
f.p = b
f.q = l
m.x = f
n.y = f
n.q = f
n.x = l
n.v = l
n.p = l
n.t = a
n.u = i
a.v = b
j.w = c
b.v = a
assert a.v.v.v.v.v.v.v.v.txt == "a"