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

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

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

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

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

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

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

i = A("i")
f = B("f")
h = C("h")
c = D("c")
j = E("j")
l = F("l")
b = G("b")
d = E("d")

i.z = h
f.v = b
h.r = d
h.s = i
h.q = i
c.s = b
c.r = l
c.t = l
c.x = l
c.u = h
c.v = i
j.x = d
l.w = d
l.o = i
l.r = b
b.z = h
b.w = c
b.y = c
b.o = f
b.t = l
d.x = j
assert j.x.x.x.x.x.x.x.x.txt == "
class A:
    def __init__(self, txt: str):
        self.z: C = None
        self.txt = txt

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

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

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

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

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

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

i = A("i")
f = B("f")
h = C("h")
c = D("c")
j = E("j")
l = F("l")
b = G("b")
d = E("d")

i.z = h
f.v = b
h.r = d
h.s = i
h.q = i
c.s = b
c.r = l
c.t = l
c.x = l
c.u = h
c.v = i
j.x = d
l.w = d
l.o = i
l.r = b
b.z = h
b.w = c
b.y = c
b.o = f
b.t = l
d.x = j
assert j.x.x.x.x.x.x.x.x.txt == "j"